Exemple #1
0
        public static void ChooseSpecialTaste()
        {
            WriteLine("\n Please choose the taste of fresh (enter name): \n");
            Freshmaker.ShowMenu(Freshmaker.BestFrashes);
            var userChoice = ReadLine();

            var selectedFresh = Freshmaker.BestFrashes.Find(x => x.Name == userChoice.ToUpper());

            if (Freshmaker.BestFrashes.Contains(selectedFresh) & customer.Cash >= selectedFresh.Price)
            {
                ChooseSize(selectedFresh);
                Freshmaker.CookFromMenu(selectedFresh);
            }
            else
            {
                WriteLine($"{userChoice} fresh does not exist in our store or you don't have enough money.");
            }
        }
Exemple #2
0
        public static void ChooseIngridients()
        {
            int freshPrice = 0;
            int i          = 1;

            while (true)
            {
                WriteLine($"\n Please choose the {i} of fresh (enter name): \n");
                i++;

                Freshmaker.ShowMenu(Freshmaker.menu);
                var userChoice = ReadLine();


                var selectedFresh = Freshmaker.menu.Find(x => x.Name == userChoice.ToUpper());
                if (Freshmaker.menu.Contains(selectedFresh))
                {
                    freshPrice += selectedFresh.Price;
                }
                else
                {
                    WriteLine($"{userChoice} fresh does not exist in our store.");
                }

                WriteLine("Do you want to add ingridient?: (1)YES/(2)NO");
                var userInput = ReadLine();

                if (userInput == "2")
                {
                    break;
                }
                else if (userInput != "1")
                {
                    WriteLine("You entered incorrect number.");
                }
            }
            Fresh userFresh = new Fresh("user", freshPrice);

            ChooseSize(userFresh);
        }