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

            return(false);
        }
Пример #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);
     }
 }
Пример #3
0
 public bool BagContains(IItem item)
 => _bag.Contains(item);