public void UpdateInventoryUI(Storeable.Type type, int amount)
 {
     if (_inventoryUIItems.ContainsKey(type))
     {
         _inventoryUIItems[type].SetText(amount);
     }
 }
Exemplo n.º 2
0
 private void onInventoryUpdated(GhostGen.GeneralEvent e)
 {
     Storeable.Type type = (Storeable.Type)e.data;
     if (type >= 0)
     {
         _buildViewController.UpdateInventoryUI(type, _inventorySystem.GetAmount(type));
     }
 }
Exemplo n.º 3
0
 public bool CanBuy(Storeable.Type type, int cost)
 {
     if (_inventory[type] >= cost)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Exemplo n.º 4
0
 public void RemoveItem(Storeable.Type type, int amount)
 {
     _inventory[type] -= amount;
 }
Exemplo n.º 5
0
        public void AddItem(Storeable.Type type, int amount)
        {
            int currentAmount = _inventory[type];

            _inventory[type] = currentAmount + amount;
        }
Exemplo n.º 6
0
 public int GetAmount(Storeable.Type type)
 {
     return(_inventory[type]);
 }
Exemplo n.º 7
0
 private void BuyBuildable(int cost)
 {
     Storeable.Type coin = Storeable.Type.Coin;
     _inventorySystem.RemoveItem(coin, cost);
     _buildViewController.UpdateInventoryUI(coin, _inventorySystem.GetAmount(coin));
 }