Exemple #1
0
        public void Render()
        {
            bool needToRender = true;

            do
            {
                while (Console.KeyAvailable)
                {
                    ConsoleKeyInfo pressedChar = Console.ReadKey(true);
                    switch (pressedChar.Key)
                    {
                    case ConsoleKey.R:
                        Console.Clear();
                        needToRender = false;
                        GUIController.RenderPlayerselectionMenu();
                        break;

                    case ConsoleKey.M:
                        Console.Clear();
                        needToRender = false;
                        GUIController.RenderMainMenu();
                        break;

                    case ConsoleKey.Q:
                        Console.Clear();
                        needToRender = false;
                        break;
                    }
                }
            } while (needToRender);
        }
Exemple #2
0
        public static void Render()
        {
            GUIController guiController = new GUIController();

            bool needToRender = true;

            do
            {
                while (Console.KeyAvailable)
                {
                    ConsoleKeyInfo pressedChar = Console.ReadKey(true);
                    int            hashCode    = pressedChar.Key.GetHashCode();

                    switch (pressedChar.Key)
                    {
                    case ConsoleKey.P:
                        Console.Clear();
                        GUIController.RenderPlayerselectionMenu();
                        needToRender = false;
                        break;

                    case ConsoleKey.Q:
                        needToRender = false;
                        break;
                    }
                }
            } while (needToRender);
        }