예제 #1
0
        public void RemoveOne(Disease target)
        {
            ItemQuantity cubes = Items.FirstOrDefault(i => i.Element == target.Color);

            if (cubes.Count > 0)
            {
                cubes.Count -= 1;
            }
        }
예제 #2
0
        public bool AddCubes(int count, ELEMENT color)
        {
            // Add cubes and return true if outbreak occurs
            ItemQuantity cubes = Items.FirstOrDefault(i => i.Element == color);

            if (cubes == null)
            {
                cubes = new ItemQuantity(color, count);
                Items.Add(cubes);
            }
            else
            {
                cubes.Add(count);
            }
            if (cubes.Count > 3)
            {
                cubes.Count = 3;
                return(true);
            }
            else
            {
                return(false);
            }
        }
예제 #3
0
        public void RemoveAll(Disease target)
        {
            ItemQuantity cubes = Items.FirstOrDefault(i => i.Element == target.Color);

            cubes.Count = 0;
        }