public static Soda HandleDrinkChoice() { while (true) { MessageHandlers.AskForDrinks(); var drinkChoice = UserInputHandlers.GetUserInput(); var validatedChoice = UserInputHandlers .ValidateDrinkChoice(drinkChoice); if (!validatedChoice.Item1) { MessageHandlers.PrintWrongChoice(); } else { return(UserChoiceHandlers .GetDrink(validatedChoice.Item2)); } } }
public static Pizza HandlePizzaChoice() { while (true) { MessageHandlers.AskForPizza(); var pizzaChoice = UserInputHandlers.GetUserInput(); var validatedChoice = UserInputHandlers .ValidatePizzaChoice(pizzaChoice); if (!validatedChoice.Item1) { MessageHandlers.PrintWrongChoice(); } else { return(UserChoiceHandlers .GetPizza(validatedChoice.Item2)); } } }