public static void EnterNumberOfSugars(Drink drink, bool isValid) { _displayText.DisplayDrinkSugarCountText(isValid); string input = Console.ReadLine(); if (_hanldeUserInput.HandleUserSugarOption(input)) { drink.SetSugars(Int32.Parse(input)); } else { EnterNumberOfSugars(drink, false); } }
public static void EnterDrinkOption(Drink drink,bool isValid) { _displayText.DisplayDrinkOptionText(isValid); // Determines what text to display to the user var input = Console.ReadLine(); if (_hanldeUserInput.HandleUserDrinkOptionInput(input)) { drink.SetDrinkType((DrinkType)Enum.Parse(typeof(DrinkType), input)); } else { EnterDrinkOption(drink, false); } }
public static void EnterMilkOption(Drink drink, bool isValid) { _displayText.DisplayMilkChoice(isValid); string input = Console.ReadLine(); if (_hanldeUserInput.HandleUserMilkOption(input)) { MilkOptions milkOptions = new MilkOptions(); drink.SetMilk(milkOptions.GetValue(input)); } else { EnterMilkOption(drink, false); } }