Merge pull request #2234 from stravant/master

Characteristic-Based rendering initial release completed unless further bugs come up before then.
This commit is contained in:
Mark Langen 2016-09-07 23:16:10 -06:00 committed by GitHub
commit 8d90f4558d
70 changed files with 518 additions and 115 deletions

View file

@ -30,12 +30,14 @@ package mage.view;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.MageObject;
import mage.ObjectColor;
import mage.abilities.Mode;
import mage.abilities.SpellAbility;
import mage.abilities.costs.mana.ManaCosts;
import mage.cards.Card;
import mage.cards.FrameStyle;
import mage.cards.SplitCard;
import mage.constants.AbilityType;
import mage.constants.CardType;
@ -53,6 +55,7 @@ import mage.game.stack.Spell;
import mage.game.stack.StackAbility;
import mage.target.Target;
import mage.target.Targets;
import org.apache.log4j.Logger;
/**
* @author BetaSteward_at_googlemail.com
@ -74,6 +77,7 @@ public class CardView extends SimpleCardView {
protected List<String> superTypes;
protected ObjectColor color;
protected ObjectColor frameColor;
protected FrameStyle frameStyle;
protected List<String> manaCost;
protected int convertedManaCost;
protected Rarity rarity;
@ -334,7 +338,10 @@ public class CardView extends SimpleCardView {
}
// Frame color
this.frameColor = card.getFrameColor(game);
this.frameColor = card.getFrameColor(game);
// Frame style
this.frameStyle = card.getFrameStyle();
// Get starting loyalty
this.startingLoyalty = "" + card.getStartingLoyalty();
@ -384,6 +391,8 @@ public class CardView extends SimpleCardView {
}
// Frame color
this.frameColor = object.getFrameColor(null);
// Frame style
this.frameStyle = object.getFrameStyle();
// Starting loyalty. Must be extracted from an ability
this.startingLoyalty = "" + object.getStartingLoyalty();
}
@ -401,6 +410,7 @@ public class CardView extends SimpleCardView {
this.displayName = name;
this.rules = emblem.getRules();
// emblem images are always with common (black) symbol
this.frameStyle = FrameStyle.M15_NORMAL;
this.expansionSetCode = emblem.getExpansionSetCode();
this.rarity = Rarity.COMMON;
}
@ -426,6 +436,7 @@ public class CardView extends SimpleCardView {
this.superTypes = new ArrayList<>();
this.color = new ObjectColor();
this.frameColor = new ObjectColor();
this.frameStyle = FrameStyle.M15_NORMAL;
this.manaCost = new ArrayList<>();
this.convertedManaCost = 0;
@ -472,6 +483,7 @@ public class CardView extends SimpleCardView {
this.superTypes = token.getSupertype();
this.color = token.getColor(null);
this.frameColor = token.getFrameColor(null);
this.frameStyle = token.getFrameStyle();
this.manaCost = token.getManaCost().getSymbols();
this.rarity = Rarity.NA;
this.type = token.getTokenType();
@ -560,6 +572,10 @@ public class CardView extends SimpleCardView {
return frameColor;
}
public FrameStyle getFrameStyle() {
return frameStyle;
}
public List<String> getManaCost() {
return manaCost;
}