end clickActionFlag

This commit is contained in:
Laure BEL 2024-05-29 13:20:09 +02:00
parent d866f7c6f1
commit 551b0583bd
2 changed files with 6 additions and 3 deletions

View File

@ -29,7 +29,7 @@ public class Sheep extends Agent {
* it can interact with the cells or with other animals
* as you wish
*/
public boolean liveTurn(ArrayList<Agent> neighbors, Simulator world) {
public boolean liveTurn(ArrayList<Agent> neighbors, World world) {
if(world.getCell(x, y)==1) {
world.setCell(x, y, 0);
} else {

View File

@ -382,9 +382,12 @@ public class Simulator extends Thread {
if (clickActionFlag==0) {
return "cell";
}else if (clickActionFlag==1) {
return "sheep";
}else if (clickActionFlag==2) {
return "wolf";
}else {
return "error";
}
return "";
}