public void EatVictim(Animal carnivore, Field field)
        {
            var savedAnimal = _genericAnimal.FindInField(field, carnivore.CoordinateX, carnivore.CoordinateY);

            savedAnimal.ClosestEnemy.Alive = false;
            savedAnimal.ClosestEnemy       = null;
        }
Example #2
0
        public void DrawAnimals(Field field, List <Animal> additionalAnimal)
        {
            for (int currentRow = 0; currentRow < field.Height; currentRow++)
            {
                for (int currentColumn = 0; currentColumn < field.Width; currentColumn++)
                {
                    var currentAnimal = _genericAnimal.FindInField(field, currentColumn, currentRow);

                    if (currentAnimal == null)
                    {
                        _facade.Write(TextParameters.Empty);
                    }
                    else if (currentAnimal.Alive)
                    {
                        _facade.Write(currentAnimal.Symbol);
                    }
                    if (currentColumn == field.Width - 1)
                    {
                        _facade.WriteLine(TextParameters.Return);
                    }
                }
            }
        }