Make the handling of counters more consistent.

This dramatically reduces the code duplication around counters handling.
This commit is contained in:
Samuel Sandeen 2016-09-03 16:52:41 -04:00
parent 148f633672
commit bec11804f5
11 changed files with 116 additions and 134 deletions

View file

@ -23,7 +23,7 @@ public class CountersSourceCount implements DynamicValue {
public int calculate(Game game, Ability sourceAbility, Effect effect) {
Permanent permanent = game.getPermanentOrLKIBattlefield(sourceAbility.getSourceId());
if (permanent != null) {
return permanent.getCounters().getCount(counter);
return permanent.getCounters(game).getCount(counter);
}
return 0;
}