Beispiel #1
0
        public bool CanBuy(IItem item, int quantity = 1)
        {
            if (_sellingItems.Contains(item) && Player.Inventory.Gold >= GetBuyGoldCost(item, quantity))
            {
                return(true);
            }

            return(false);
        }
Beispiel #2
0
 public void Pull(IItem item, int quantity = 1)
 {
     if (_cubeList.Contains(item))
     {
         var quantityToRemove = Math.Min(item.Quantity, quantity);
         item.Quantity -= quantityToRemove;
         if (item.Quantity <= 0)
         {
             _cube.Remove(item);
         }
         var itemToAdd = item.Clone();
         itemToAdd.Quantity = quantityToRemove;
         InventoryService.Add(itemToAdd);
     }
 }
 public bool BagContains(IItem item)
 => _bag.Contains(item);