예제 #1
0
        public int GetPotNumberSum()
        {
            var sum = 0;

            foreach (var kvp in PotDict.Where(x => x.Value.ContainsPlant))
            {
                sum += kvp.Value.PotNumber;
            }

            return(sum);
        }
예제 #2
0
        private void trim()
        {
            for (var i = LowerBound; i <= LowerPotWithPlant - 5; i++)
            {
                PotDict.Remove(i);
                LowerBound++;
            }

            for (var i = UpperBound; i >= UpperPotWithPlant + 5; i--)
            {
                PotDict.Remove(i);
                UpperBound--;
            }
        }