From 2755e9695b717d65d1502cee9ce7e7d8f7fe1069 Mon Sep 17 00:00:00 2001 From: laure Date: Fri, 31 May 2024 21:31:15 +0200 Subject: [PATCH] last comments --- src/backend/Wolf.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/backend/Wolf.java b/src/backend/Wolf.java index 7ef89e4..42d401b 100644 --- a/src/backend/Wolf.java +++ b/src/backend/Wolf.java @@ -26,12 +26,11 @@ public class Wolf extends Agent { * as you wish */ public boolean liveTurn(ArrayList neighbors, Simulator world) { - //ArrayList nearby=world.getNeighboringAnimals(x,y,1); //look if the cell has an agent - if (!neighbors.isEmpty()) { + if (!neighbors.isEmpty()) { //checks if the adjacent cells are empty ; if it's a sheep, it makes another sheep appear and delete it, which makes both disappear if(world.typeAnimals(x,y, neighbors)== "Sheep") { Sheep sheep = new Sheep(x,y) ; world.getAnimals().remove(sheep); - hunger=hunger-1; + hunger=hunger-1; }else { hunger++; }