public void RemoveOne(Disease target) { ItemQuantity cubes = Items.FirstOrDefault(i => i.Element == target.Color); if (cubes.Count > 0) { cubes.Count -= 1; } }
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); } }
public void RemoveAll(Disease target) { ItemQuantity cubes = Items.FirstOrDefault(i => i.Element == target.Color); cubes.Count = 0; }