Beispiel #1
0
 public void RevomeFromInventory(Item item)
 {
     foreach (Item i in _inventoryItems)
     {
         if (i.GetItemCategory() == item.GetItemCategory())
         {
             _inventoryItems.Remove(i);
             break;
         }
     }
 }
Beispiel #2
0
        public bool AddToInventory(Item item, Character character)
        {
            if (IsCategoryPresent(item.GetItemCategory()))
            {
                return(false);
            }

            else
            {
                _inventoryItems.Add(item);

                character._defence += item._ItemDefence;
                character._attack  += item._ItemAttack;
                return(true);
            }
        }