Refactor: fixed getRules usage, clean SplitCard code

This commit is contained in:
Oleg Agafonov 2023-04-08 19:01:04 +04:00
parent 8f748b0f2c
commit 914cfc1d3a
9 changed files with 70 additions and 51 deletions

View file

@ -388,11 +388,7 @@ public class CardView extends SimpleCardView {
this.name = card.getImageName();
this.displayName = card.getName();
this.displayFullName = fullCardName;
if (game == null) {
this.rules = new ArrayList<>(card.getRules());
} else {
this.rules = new ArrayList<>(card.getRules(game));
}
this.rules = new ArrayList<>(card.getRules(game));
this.manaValue = card.getManaValue();
if (card instanceof Permanent) {
@ -627,7 +623,7 @@ public class CardView extends SimpleCardView {
PermanentToken permanentToken = (PermanentToken) object;
this.rarity = Rarity.COMMON;
this.expansionSetCode = permanentToken.getExpansionSetCode();
this.rules = new ArrayList<>(permanentToken.getRules());
this.rules = new ArrayList<>(permanentToken.getRules(game));
this.type = permanentToken.getToken().getTokenType();
} else if (object instanceof Emblem) {
this.mageObjectType = MageObjectType.EMBLEM;