Example #1
0
        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);
            }
        }
Example #2
0
        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);
            }
        }
Example #3
0
        public void addObstacles()
        {
            Coordinate empty;

            for (int i = 0; i < NumObstacles; i++)
            {
                empty = LogicMove.getEmptyCellCoord(this);
                cells[empty._y, empty._x] = new Obstacles(empty);
            }
        }