From a6f75c507c6cbd6a73b8d56d143439988b37ceae Mon Sep 17 00:00:00 2001 From: laure Date: Thu, 30 May 2024 10:13:27 +0200 Subject: [PATCH] wolf clikCell --- src/backend/Agent.java | 2 +- src/backend/Simulator.java | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/backend/Agent.java b/src/backend/Agent.java index bc71b36..9a8cc1c 100644 --- a/src/backend/Agent.java +++ b/src/backend/Agent.java @@ -33,7 +33,7 @@ public abstract class Agent { // Does whatever the agent does during a step // then returns a boolean // if false, agent dies at end of turn - // see step function in Simulator + // see step function in Simulator public abstract boolean liveTurn(ArrayList neighbors, Simulator world); diff --git a/src/backend/Simulator.java b/src/backend/Simulator.java index 795a360..4e63b76 100644 --- a/src/backend/Simulator.java +++ b/src/backend/Simulator.java @@ -79,7 +79,6 @@ public class Simulator extends Thread { System.out.println("wrong file buddy, this one's empty"); }else if(surviveCells.length<=0) { System.out.println("wrong file buddy, this one's does not have survival rules, won't work"); - return; }else { for (int x = 0; x < birthCells.length; x++) { String elem = birthCells[x]; @@ -295,8 +294,8 @@ public class Simulator extends Thread { } else if (clickActionFlag==2) { // wolf ArrayList nearby=getNeighboringAnimals(x,y,1); if (nearby.isEmpty()) { - Sheep sheep = new Sheep(x,y); - agents.add(sheep); + Wolf wolf = new Wolf(x,y); + agents.add(wolf); }else { for (Agent animal:nearby) { agents.remove(animal);