public Setup AskForAmountOfPlayers() { var reponse = _playerInterface.Ask(PlayerInterfaceQuestions.AskAmountOfPlayers); int amount; if ( !Int32.TryParse(reponse, out amount) || amount < 1 || amount > 6 ) { _playerInterface.Tell(PlayerInterfaceQuestions.MustEnterAValidNumber); return(AskForAmountOfPlayers()); } else { _amountOfPlayers = amount; } return(this); }
public Setup AskForAmountOfPlayers() { // Console.WriteLine("How many players will be playing the game?"); // var response = Console.ReadLine(); var reponse = _playerInterface.Ask(PlayerInterfaceQuestions.AskAmountOfPlayers); int amount; if ( !Int32.TryParse(reponse, out amount) || amount < 1 || amount > 6 ) { _playerInterface.Tell(PlayerInterfaceQuestions.MustEnterAValidNumber); return(AskForAmountOfPlayers()); } else { _amountOfPlayers = amount; } return(this); }