Ejemplo n.º 1
0
 public void AddSugarCubesToInventory(int numberOfSugarCubes)
 {
     for (int i = 0; i < numberOfSugarCubes; i++)
     {
         SugarCube sugarCube = new SugarCube();
         sugarCubes.Add(sugarCube);
     }
 }
Ejemplo n.º 2
0
 public void SubtractSugarCubesFromInventory(Inventory inventory)
 {
     for (int i = 4; i < amountOfSugarCubes; i--)
     {
         SugarCube sugarCube = new SugarCube();
         inventory.sugarCubes.Remove(sugarCube);
     }
 }
Ejemplo n.º 3
0
 public void SubtractSugarCubesFromInventory(int numberOfSugarCubes)
 {
     for (int i = 0; i < numberOfSugarCubes; i++)
     {
         SugarCube sugarCube = new SugarCube();
         sugarCubes.Remove(sugarCube);
     }
 }
Ejemplo n.º 4
0
        public void BuySugarCubes(Player player)
        {
            SugarCube sugarCube = new SugarCube();

            if (player.wallet.Money >= pricePerSugarCube * bulkQty)
            {
                UserInterface.BuyItem(bulkQty, sugarCube.name);
                player.wallet.Money -= bulkSugarPrice;
                for (int i = 0; i < bulkQty; i++)
                {
                    player.inventory.sugarCubes.Add(sugarCube);
                }
            }
            else
            {
                UserInterface.NotEnoughMoney(sugarCube.name);
            }
        }
Ejemplo n.º 5
0
        public void AddSugar(Inventory inventory)
        {
            SugarCube sugarCube = new SugarCube();

            UserInterface.AddItemsToRecipe(sugarCube.name);
            try
            {
                amountOfSugarCubes = Math.Abs(Int32.Parse(Console.ReadLine()));
                if (amountOfSugarCubes > inventory.sugarCubes.Count)
                {
                    UserInterface.NotEnoughInventory(sugarCube.name);
                    AddSugar(inventory);
                }
            }
            catch (FormatException)
            {
                UserInterface.NotAValidOption();
                AddSugar(inventory);
            }
        }
 public void AddSugar(SugarCube sugarCube)
 {
     supplies[1].Add(sugarCube);
 }