Example #1
0
        public int?[] GetSelectedGames()
        {
            var selectedGames = new int?[ConstantValues.MaxRunningGames];

            _consoleUserInterface.AskForSelectedGames();
            for (int i = 0; i < ConstantValues.MaxRunningGames; i++)
            {
                int    gameNo;
                string input = Console.ReadLine();
                while (!int.TryParse(input, out gameNo))
                {
                    Console.WriteLine("Invalid input.");
                    Console.WriteLine("Enter game no. to show: ");
                    input = Console.ReadLine();
                }
                if (gameNo == 0)
                {
                    break;
                }
                selectedGames[i] = gameNo - 1;
            }
            return(selectedGames);
        }