# WARNING: head commit changed in the meantime
Merge branch 'master' of https://gitarero.ecam.fr/laure.bel/OOP_F3_Project.git
This commit is contained in:
parent
65d2baabfd
commit
7a79420cd1
|
|
@ -327,7 +327,15 @@ public class Simulator extends Thread {
|
||||||
}
|
}
|
||||||
return inArea;
|
return inArea;
|
||||||
}
|
}
|
||||||
|
public String typeAnimals(int x , int y,ArrayList<Agent> neighbor) {
|
||||||
|
//ArrayList<Agent> neighbor =getNeighboringAnimals(x,y,1);
|
||||||
|
Agent agent = neighbor.get(0);
|
||||||
|
if (agent instanceof Wolf) {
|
||||||
|
return "Wolf";
|
||||||
|
} else {
|
||||||
|
return "Sheep";
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* set value of cell
|
* set value of cell
|
||||||
* @param x coord of cell
|
* @param x coord of cell
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ public class Wolf extends Agent {
|
||||||
* as you wish
|
* as you wish
|
||||||
*/
|
*/
|
||||||
public boolean liveTurn(ArrayList<Agent> neighbors, Simulator world) {
|
public boolean liveTurn(ArrayList<Agent> neighbors, Simulator world) {
|
||||||
if(world.getCell(x, y)==1) {
|
if(world.getCell(x, y)== Sheep sheep) {
|
||||||
world.setCell(x, y, 0);
|
world.setCell(x, y, 0);
|
||||||
} else {
|
} else {
|
||||||
hunger++;
|
hunger++;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue