public void DietConsume(string name, int count = 1) { if (CookedDietDic.ContainsKey(name)) { CookedDietDic[name] -= count; } }
public void AddDiet(string name, int count = 1) { if (!CookedDietDic.ContainsKey(name)) { CookedDietDic.Add(name, 0); } CookedDietDic[name] += count; if (CookingHistory == null) { CookingHistory = new Dictionary <string, int>(); } if (!CookingHistory.ContainsKey(name)) { CookingHistory.Add(name, 0); } CookingHistory[name] += count; }
public bool CheckDiet(string name, int count = 1) { return(CookedDietDic.ContainsKey(name) && CookedDietDic[name] >= count); }