Esempio n. 1
0
        public static void PlaceItem(Point location)
        {
            if (itemToPlace != null && IsClear(location)) {
                Item newItem = itemToPlace.BaseItem.CreateNewItem();
                newItem.SetLocation(location);
                AddEntity(newItem);

                newItem.ActionOnPlace(location);

                RemoveItemFromInventory(itemToPlace);
                itemToPlace = null;
            }
        }
Esempio n. 2
0
 public static void RemoveItemFromInventory(ShopItem item)
 {
     if (inventory.ContainsKey(item) && --inventory[item] <= 0) {
         inventory.Remove(item);
     }
 }
Esempio n. 3
0
 public static void AddItemToInventory(ShopItem item)
 {
     if (!inventory.ContainsKey(item)) {
         inventory[item] = 0;
     }
     inventory[item]++;
 }