removing view-related code from Card class.

This commit is contained in:
Maxmtg
2013-03-06 10:49:29 +00:00
parent 0836137755
commit f47e73adbf
2 changed files with 4 additions and 17 deletions

View File

@@ -1632,21 +1632,6 @@ public class Card extends GameEntity implements Comparable<Card> {
return this.getCharacteristics().getManaCost(); return this.getCharacteristics().getManaCost();
} }
/**
* <p>
* Display for the field <code>manaCost</code>.
* </p>
*
* @return a {@link java.lang.String} object.
*/
public final String getManaDisplay() {
// If this is a split card, display mana as X / Y. Otherwise, Display it as normal
if (this.getRules() != null && this.getRules().getSplitType() == CardSplitType.Split) {
return String.format("%s / %s", this.getState(CardCharacteristicName.LeftSplit).getManaCost(),
this.getState(CardCharacteristicName.RightSplit).getManaCost());
}
return this.getCharacteristics().getManaCost().toString();
}
/** /**
* <p> * <p>

View File

@@ -202,10 +202,12 @@ public class CardDetailPanel extends FPanel {
final boolean canShowThis = card.canBeShownTo(Singletons.getControl().getPlayer()); final boolean canShowThis = card.canBeShownTo(Singletons.getControl().getPlayer());
if (canShowThis) { if (canShowThis) {
if (card.getManaCost().toString().equals("") || card.isLand()) { if (card.getManaCost().isNoCost()) {
this.nameCostLabel.setText(card.getName()); this.nameCostLabel.setText(card.getName());
} else { } else {
this.nameCostLabel.setText(card.getName() + " - " + card.getManaDisplay()); // If you want to make a special view of split cards, keep that special code in this class.
// Better if you make several labels that that draw mana symbols
this.nameCostLabel.setText(card.getName() + " - " + card.getManaCost());
} }
this.typeLabel.setText(GuiDisplayUtil.formatCardType(card)); this.typeLabel.setText(GuiDisplayUtil.formatCardType(card));