end clickActionFlag
This commit is contained in:
parent
d866f7c6f1
commit
551b0583bd
|
|
@ -29,7 +29,7 @@ public class Sheep extends Agent {
|
||||||
* it can interact with the cells or with other animals
|
* it can interact with the cells or with other animals
|
||||||
* as you wish
|
* 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) {
|
if(world.getCell(x, y)==1) {
|
||||||
world.setCell(x, y, 0);
|
world.setCell(x, y, 0);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -382,9 +382,12 @@ public class Simulator extends Thread {
|
||||||
if (clickActionFlag==0) {
|
if (clickActionFlag==0) {
|
||||||
return "cell";
|
return "cell";
|
||||||
}else if (clickActionFlag==1) {
|
}else if (clickActionFlag==1) {
|
||||||
|
return "sheep";
|
||||||
|
}else if (clickActionFlag==2) {
|
||||||
|
return "wolf";
|
||||||
|
}else {
|
||||||
|
return "error";
|
||||||
}
|
}
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue