mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
removing view-related code from Card class.
This commit is contained in:
@@ -1632,21 +1632,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
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>
|
||||
|
||||
@@ -202,10 +202,12 @@ public class CardDetailPanel extends FPanel {
|
||||
|
||||
final boolean canShowThis = card.canBeShownTo(Singletons.getControl().getPlayer());
|
||||
if (canShowThis) {
|
||||
if (card.getManaCost().toString().equals("") || card.isLand()) {
|
||||
if (card.getManaCost().isNoCost()) {
|
||||
this.nameCostLabel.setText(card.getName());
|
||||
} 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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user