public bool ContainsEnoughItems(string itemType, int itemAmount) { int itemsFound = InventorySlots.Where(t => t.HasItem && t.SlotItem.ItemData.Type == itemType).Sum(t => t.SlotItem.Item.Amount); return(itemsFound >= itemAmount); }
public bool ContainsEnoughItems(ItemDefinition item) { int itemsFound = InventorySlots.Where(t => t.HasItem && t.SlotItem.ItemData.Id == item.Id).Sum(t => t.SlotItem.Item.Amount); return(itemsFound >= item.Amount); }