예제 #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);
            }
        }
예제 #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);
            }
        }
예제 #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);
            }
        }