diff --git a/src/backend/Wolf.java b/src/backend/Wolf.java index 189b1e7..b8013fa 100644 --- a/src/backend/Wolf.java +++ b/src/backend/Wolf.java @@ -26,8 +26,13 @@ public class Wolf extends Agent { * as you wish */ public boolean liveTurn(ArrayList neighbors, Simulator world) { - if(world.getCell(x, y)== Sheep sheep) { - world.setCell(x, y, 0); + //ArrayList nearby=world.getNeighboringAnimals(x,y,1); //look if the cell has an agent + if (!neighbors.isEmpty()) { + if(world.typeAnimals(x,y, neighbors)== "Sheep") { + Sheep sheep = new Sheep(x,y) ; + world.getAnimals().remove(sheep); + } + } else { hunger++; }