Example #1
0
        public void SetRecipe(UI ui, List <string> options, Game game)
        {
            string userInput;
            int    userQuantityInput = 0;
            bool   exitIsSelected    = false;

            while (!exitIsSelected)
            {
                Console.Clear();
                ui.DisplayRecipeMenu(this);
                userInput = ui.GetUserInput(options, game);
                switch (userInput)
                {
                case "1":
                    userInput         = ui.GetUserQuantityInput();
                    userQuantityInput = ui.ConvertStringToNumber(userInput, userQuantityInput);
                    SetLemonsAmount(userQuantityInput);
                    break;

                case "2":
                    userInput         = ui.GetUserQuantityInput();
                    userQuantityInput = ui.ConvertStringToNumber(userInput, userQuantityInput);
                    SetSugarsAmount(userQuantityInput);
                    break;

                case "3":
                    userInput         = ui.GetUserQuantityInput();
                    userQuantityInput = ui.ConvertStringToNumber(userInput, userQuantityInput);
                    SetIceAmount(userQuantityInput);
                    break;

                case "4":
                    userInput         = ui.GetUserQuantityInput();
                    userQuantityInput = ui.ConvertStringToNumber(userInput, userQuantityInput);
                    SetLemonadePrice(userQuantityInput);
                    break;

                case "5":
                    exitIsSelected = true;
                    break;
                }
            }
        }