public void AddIngredient(int itemID, int quantity) { if (!RequiredItems.Any(x => x.ItemId == itemID)) { RequiredItems.Add(new ItemQuantity(itemID, quantity)); } }
/// <summary> /// /// </summary> /// <param name="templateIds"></param> /// <param name="quantity"></param> /// <returns></returns> public bool Match(Dictionary <int, long> templates, long kamas) { return(RequiredKamas == kamas && RequiredItems.All(required => templates.Any(template => required.TemplateId == template.Key && required.Quantity == template.Value)) && templates.All(template => RequiredItems.Any(required => required.TemplateId == template.Key && required.Quantity == template.Value))); }