Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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);
            }
        }