コード例 #1
0
        public static bool PlayersCountChoiceScreen()
        {
            ConsolePrinter.SinglePlayerScreen();
            ConsoleKeyInfo arrowKeyChoice = new ConsoleKeyInfo((char)38, ConsoleKey.UpArrow, false, false, false);

            ConsoleKeyInfo playersChoise = Console.ReadKey(true);

            while (playersChoise.Key != ConsoleKey.Enter)
            {
                if (playersChoise.Key == ConsoleKey.DownArrow)
                {
                    ConsolePrinter.MultiPlayerScreen();
                }
                else if (playersChoise.Key == ConsoleKey.UpArrow)
                {
                    ConsolePrinter.SinglePlayerScreen();
                }

                arrowKeyChoice = playersChoise;
                playersChoise  = Console.ReadKey(true);
            }

            return(arrowKeyChoice.Key == ConsoleKey.UpArrow ? false : true);
        }