forked from External/mage
Make the handling of counters more consistent.
This dramatically reduces the code duplication around counters handling.
This commit is contained in:
parent
148f633672
commit
bec11804f5
11 changed files with 116 additions and 134 deletions
|
|
@ -346,21 +346,4 @@ public abstract class MeldCard extends CardImpl {
|
|||
return returnState;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addCounters(String name, int amount, Game game, ArrayList<UUID> appliedEffects) {
|
||||
if (this.isMelded()) {
|
||||
return super.addCounters(name, amount, game, appliedEffects);
|
||||
} else {
|
||||
// can this really happen?
|
||||
boolean returnState = true;
|
||||
if (topLastZoneChangeCounter == topHalfCard.getZoneChangeCounter(game)) {
|
||||
returnState |= topHalfCard.addCounters(name, amount, game, appliedEffects);
|
||||
}
|
||||
if (bottomLastZoneChangeCounter == bottomHalfCard.getZoneChangeCounter(game)) {
|
||||
returnState |= bottomHalfCard.addCounters(name, amount, game, appliedEffects);
|
||||
}
|
||||
return returnState;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue