Пример #1
0
        public void CreateGamefield()
        {
            field = _fieldFactory.CreateField();
            bool filledWithAnimals = false;

            while (!filledWithAnimals)
            {
                _facade.SetCursorPosition();
                _display.DrawAnimals(field);

                var key = _facade.ConsoleKey();

                var animalKey = key == TextParameters.AntelopeKey ||
                                key == TextParameters.LionKey;


                if (key == TextParameters.EnterKey)
                {
                    filledWithAnimals = true;
                    LifeCycle(field);
                }
                else if (animalKey)
                {
                    _animalFactory.CreateAnimal(key, field);
                }
            }
        }