public void AddCounters(int amount, CounterType counter) { for (int i = 0; i < amount; i++) { switch (counter) { case CounterType.Energy: case CounterType.Poison: counters.Add(counter); break; default: // Other types can't be placed on this object break; } } CountersCreated?.Invoke(this, counter, amount); }
public void AddCounters(IResolvable source, int amount, CounterType counter) { for (int i = 0; i < amount; i++) { switch (counter) { case CounterType.Plus1Plus1: if (counters.Contains(CounterType.Minus1Minus1)) { counters.Remove(CounterType.Minus1Minus1); } else { counters.Add(CounterType.Plus1Plus1); } break; case CounterType.Minus1Minus1: if (counters.Contains(CounterType.Plus1Plus1)) { counters.Remove(CounterType.Plus1Plus1); } else { counters.Add(CounterType.Minus1Minus1); } break; case CounterType.Charge: case CounterType.Corpse: case CounterType.Ice: case CounterType.Spore: counters.Add(counter); break; default: // Other types can't be placed on this object break; } } CountersCreated?.Invoke(this, source, counter, amount); }