Ejemplo n.º 1
0
 public void AddIce(Player player)
 {
     for (int i = 0; i < moreIce; i++)
     {
         IceCube ice = new IceCube();
         player.inventory.iceCubes.Add(ice);
     }
     player.wallet.Money -= pricePerIceCube * moreIce;
 }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
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);
            }
        }
Ejemplo n.º 4
0
 public void AddInventory()
 {
     for (int i = 0; i < 10; i++)
     {
         Lemon lemon = new Lemon();
         inventory.lemons.Add(lemon);
     }
     for (int i = 0; i < 10; i++)
     {
         SugarCube sugar = new SugarCube();
         inventory.sugarCubes.Add(sugar);
     }
     for (int i = 0; i < 10; i++)
     {
         IceCube ice = new IceCube();
         inventory.iceCubes.Add(ice);
     }
     for (int i = 0; i < 10; i++)
     {
         Cup cup = new Cup();
         inventory.cups.Add(cup);
     }
 }