public void Update() { CookedDietDic.Remove(p => p == 0); FlavoringDic.Remove(p => p == 0); MongoService <CookingRecord> .Update(this); }
public void FlavoringIncome(string flavoringName, int count = 1) { if (!FlavoringDic.ContainsKey(flavoringName)) { FlavoringDic.Add(flavoringName, 0); } FlavoringDic[flavoringName] += count; }
public bool CheckFlavorings(Dictionary <string, int> fDic) { if (FlavoringDic.IsNullOrEmpty()) { return(false); } foreach (var(name, count) in fDic) { if (!FlavoringDic.ContainsKey(name) || FlavoringDic[name] < count) { return(false); } } return(true); }