예제 #1
0
        public void AddFWolf(int x, int y)
        {
            IAnimal animal = new FWolf(cells[x, y], _random);

            Animals.Add(animal);
            animal.Death += Animal_Die;
        }
예제 #2
0
        public void Renovate(int rabitsCount, int FWolfsCount, int MWolfsCount)
        {
            Cell    tmp;
            IAnimal animal;

            _rabitsCount = rabitsCount;
            _MWolfsCount = MWolfsCount;
            _FWolfsCount = FWolfsCount;

            for (int i = 0; i < rabitsCount; i++)
            {
                tmp = RandomEmptyCell();
                if (tmp != null)
                {
                    animal = new Rabit(tmp, _random);
                    Animals.Add(animal);
                    animal.Death += Animal_Die;
                }
            }

            for (int i = 0; i < FWolfsCount; i++)
            {
                tmp = RandomEmptyCell();
                if (tmp != null)
                {
                    animal = new FWolf(tmp, _random);
                    Animals.Add(animal);
                    animal.Death += Animal_Die;
                }
            }

            for (int i = 0; i < MWolfsCount; i++)
            {
                tmp = RandomEmptyCell();
                if (tmp != null)
                {
                    animal = new MWolf(tmp, _random);
                    Animals.Add(animal);
                    animal.Death += Animal_Die;
                }
            }
        }