public bool CanBuy(IItem item, int quantity = 1) { if (_sellingItems.Contains(item) && Player.Inventory.Gold >= GetBuyGoldCost(item, quantity)) { return(true); } return(false); }
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);