public int GetUserGameSelection() { var gameSelection = Console.ReadLine(); var validInput = UserInputValidation.GameSelectionCheck(gameSelection); if (!validInput) { Console.WriteLine("Please enter a valid number, try again:"); return(GetUserGameSelection()); } return(int.Parse(gameSelection)); }
private static void UserDefinedGame(string gameSelection) { var validInput = UserInputValidation.GameSelectionCheck(gameSelection); if (!validInput) { Console.WriteLine("Invalid game selection"); } else { var game = new Game(); var gameChoice = game.Start(int.Parse(gameSelection)); Console.WriteLine(gameChoice.Play()); } }