Example #1
0
 public void AddIceCubesToInventory(int numberOfIceCubes)
 {
     for (int i = 0; i < numberOfIceCubes; i++)
     {
         IceCube iceCube = new IceCube();
         iceCubes.Add(iceCube);
     }
 }
Example #2
0
 public void SubtractIceCubesFromInventory(Inventory inventory)
 {
     for (int i = 4; i < amountOfIceCubes; i--)
     {
         IceCube iceCube = new IceCube();
         inventory.iceCubes.Remove(iceCube);
     }
 }
Example #3
0
 public void SubtractIceCubesFromInventory(int numberOfIceCubes)
 {
     for (int i = 0; i < numberOfIceCubes; i++)
     {
         IceCube iceCube = new IceCube();
         iceCubes.Remove(iceCube);
     }
 }
Example #4
0
        public void BuyIceCubes(Player player)
        {
            IceCube iceCube = new IceCube();

            if (player.wallet.Money >= pricePerIceCube * bulkQty)
            {
                UserInterface.BuyItem(bulkQty, iceCube.name);
                player.wallet.Money -= bulkIcePrice;
                for (int i = 0; i < bulkQty; i++)
                {
                    player.inventory.iceCubes.Add(iceCube);
                }
            }
            else
            {
                UserInterface.NotEnoughMoney(iceCube.name);
            }
        }
Example #5
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);
            }
        }
 public void AddIce(IceCube iceCube)
 {
     supplies[2].Add(iceCube);
 }