Exemplo n.º 1
0
        public void SetLemondadeRecipe(string itemToAddToRecipe)
        {
            if (itemToAddToRecipe == "1" || itemToAddToRecipe == "lemons")
            {
                recipe.amountOfLemons = UserInterface.PromptForNumberOfItemsInRecipe("lemons");
            }
            else if (itemToAddToRecipe == "2" || itemToAddToRecipe == "sugar cubes")
            {
                recipe.amountOfSugarCubes = UserInterface.PromptForNumberOfItemsInRecipe("sugar cubes");
            }
            else if (itemToAddToRecipe == "3" || itemToAddToRecipe == "ice cubes")
            {
                recipe.amountOfIceCubes = UserInterface.PromptForNumberOfItemsInRecipe("ice cubes");
            }

            else if (itemToAddToRecipe == "4" || itemToAddToRecipe == "price per cup")
            {
                bool UserInputIsADouble = false;
                while (UserInputIsADouble == false || recipe.pricePerCup < 0)
                {
                    UserInterface.AskForPricePerCup();
                    UserInputIsADouble = double.TryParse(UserInterface.TakePlayerInput(), out recipe.pricePerCup);
                }
            }

            else
            {
                UserInterface.DisplayInvalidSelectionMessage();
            }
        }