示例#1
0
        public void Update()
        {
            CookedDietDic.Remove(p => p == 0);
            FlavoringDic.Remove(p => p == 0);

            MongoService <CookingRecord> .Update(this);
        }
示例#2
0
        public void FlavoringIncome(string flavoringName, int count = 1)
        {
            if (!FlavoringDic.ContainsKey(flavoringName))
            {
                FlavoringDic.Add(flavoringName, 0);
            }

            FlavoringDic[flavoringName] += count;
        }
示例#3
0
        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);
        }