示例#1
0
        public void CreatePitchers(Player player)
        {
            Console.WindowWidth = 50;
            InsertPitcherPicture();
            Console.Write(" How many pitchers would you like to make?: ");
            string pitcherInput = Console.ReadLine();

            try
            {
                pitcherQuantity = Convert.ToInt32(pitcherInput);
                CheckForPositiveAmount(player);
            }
            catch
            {
                Console.WriteLine("\n Error..Please try again.");
                TakeBreak();
                Console.Clear();
                CreatePitchers(player);
            }
            for (int i = 0; i < pitcherQuantity; i++)
            {
                if (CheckForSufficientIngredients(player.playerRecipe.ingredientLemon, player.playerRecipe.ingredientSugar, player.playerRecipe.ingredientIce, 10))
                {
                    Pitcher pitcher = new Pitcher(player.playerInventory);
                    pitchers.Add(pitcher);
                    RemoveItems(player.playerRecipe);
                }
                else
                {
                    Console.Clear();
                    Console.WriteLine("\n Error..Insufficient ingredients.");
                    TakeBreak();
                    Console.Clear();
                }
            }
            Console.Clear();
            DisplayPitcherAmount();
        }