Exemplo n.º 1
0
        public void ShowMenu()
        {
            bool needToRender = false;

            _gameWind.Render();
            do
            {
                while (Console.KeyAvailable)
                {
                    ConsoleKeyInfo pressedChar = Console.ReadKey(true);
                    switch (pressedChar.Key)
                    {
                    case ConsoleKey.Q:
                        _gameWind.ShowQuitButton();
                        break;

                    case ConsoleKey.P:
                        _gameWind.ShowPlayButton();
                        break;

                    case ConsoleKey.Enter:
                        if (_gameWind.EnterPressing() == 0)
                        {
                            Console.Clear();
                            _gamePlay.StartGameLoop();
                        }
                        else if (_gameWind.EnterPressing() == 1)
                        {
                            Environment.Exit(0);
                        }
                        break;
                    }
                }
            } while (needToRender == false);
        }