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; }
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); } }
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 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); } }