now realy uptodate
This commit is contained in:
parent
2d7b199765
commit
127cc64841
|
|
@ -198,7 +198,15 @@ public class Simulator extends Thread {
|
|||
* method called when clicking on a cell in the interface
|
||||
*/
|
||||
public void clickCell(int x, int y) {
|
||||
setCell(x, y, getCell(x, y) == 1 ? 0 : 1);
|
||||
if (clickActionFlag==0) { // cell
|
||||
setCell(x, y, getCell(x, y) == 1 ? 0 : 1);
|
||||
} else if (clickActionFlag==1) { // sheep
|
||||
Sheep sheep = new Sheep(x,y);
|
||||
agents.add(sheep);
|
||||
} else if (clickActionFlag==2) { // wolf
|
||||
Wolf wolf = new Wolf(x,y);
|
||||
agents.add(wolf);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue