Esempio n. 1
0
 public void DietConsume(string name, int count = 1)
 {
     if (CookedDietDic.ContainsKey(name))
     {
         CookedDietDic[name] -= count;
     }
 }
Esempio n. 2
0
        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;
        }
Esempio n. 3
0
 public bool CheckDiet(string name, int count = 1)
 {
     return(CookedDietDic.ContainsKey(name) && CookedDietDic[name] >= count);
 }