Exemple #1
0
        public void AddIce(Inventory inventory)
        {
            IceCube iceCube = new IceCube();

            UserInterface.AddItemsToRecipe(iceCube.name);
            try
            {
                amountOfIceCubes = Math.Abs(Int32.Parse(Console.ReadLine()));
                if (amountOfIceCubes > inventory.iceCubes.Count)
                {
                    UserInterface.NotEnoughInventory(iceCube.name);
                    AddIce(inventory);
                }
            }
            catch (FormatException)
            {
                UserInterface.NotAValidOption();
                AddIce(inventory);
            }
        }
Exemple #2
0
        //Constructor
        public void AddLemons(Inventory inventory)
        {
            Lemon lemon = new Lemon();

            UserInterface.AddItemsToRecipe(lemon.name);
            try
            {
                amountOfLemons = Math.Abs(Int32.Parse(Console.ReadLine()));
                if (amountOfLemons > inventory.lemons.Count)
                {
                    UserInterface.NotEnoughInventory(lemon.name);
                    AddLemons(inventory);
                }
            }
            catch (FormatException)
            {
                UserInterface.NotAValidOption();
                AddLemons(inventory);
            }
        }