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

@ -159,18 +159,4 @@ public class PermanentMeld extends PermanentCard {
}
return false;
}
@Override
public boolean addCounters(String name, int amount, Game game, ArrayList<UUID> appliedEffects) {
MeldCard meldCard = (MeldCard) this.getCard();
if (meldCard.isMelded()) {
return super.addCounters(name, amount, game, appliedEffects);
} else {
// can this really happen?
boolean returnState = true;
returnState |= meldCard.getTopHalfCard().addCounters(name, amount, game, appliedEffects);
returnState |= meldCard.getBottomHalfCard().addCounters(name, amount, game, appliedEffects);
return returnState;
}
}
}