public void addPredators(ISwim pred) { Coordinate empty; for (int i = 0; i < NumPredator; i++) { empty = LogicMove.getEmptyCellCoord(this); cells[empty._y, empty._x] = new Predator(empty, pred); } }
public void addPrey(ISwim prey) { Coordinate empty; for (int i = 0; i < NumPrey; i++) { empty = LogicMove.getEmptyCellCoord(this); cells[empty._y, empty._x] = new Prey(empty, prey, Prey.TIME_TO_REPRODUCE); } }
public void addObstacles() { Coordinate empty; for (int i = 0; i < NumObstacles; i++) { empty = LogicMove.getEmptyCellCoord(this); cells[empty._y, empty._x] = new Obstacles(empty); } }