mirror of
https://github.com/correl/mage.git
synced 2024-11-14 19:19:32 +00:00
Refactor: removed outdated code for non implemented cards
This commit is contained in:
parent
a464333761
commit
38a45c2e8e
5 changed files with 5 additions and 20 deletions
|
@ -398,18 +398,6 @@ public class MageBook extends JComponent {
|
|||
|
||||
cardImg.setCardCaptionTopOffset(8); // card caption below real card caption to see full name even with mana icons
|
||||
|
||||
boolean implemented = card.getRarity() != Rarity.NA;
|
||||
|
||||
// implemented label
|
||||
// old code, nowadays app load only implemented cards (JayDi85, 23.11.2017)
|
||||
/*
|
||||
GlowText label = new GlowText();
|
||||
label.setGlow(implemented ? Color.green : NOT_IMPLEMENTED, 12, 0.0f);
|
||||
label.setText(implemented ? "Implemented" : "Not implemented");
|
||||
int dx = implemented ? 15 : 5;
|
||||
label.setBounds(rectangle.x + dx, rectangle.y + cardDimensions.frameHeight + 7, 110, 30);
|
||||
jLayeredPane.add(label);
|
||||
*/
|
||||
// card number label
|
||||
JLabel cardNumber = new JLabel();
|
||||
int dy = -5; // image panel have empty space in bottom (bug?), need to move label up
|
||||
|
|
|
@ -121,16 +121,14 @@ public class CardPluginImpl implements CardPlugin {
|
|||
@Override
|
||||
public MagePermanent getMagePermanent(PermanentView permanent, Dimension dimension, UUID gameId, ActionCallback callback, boolean canBeFoil, boolean loadImage) {
|
||||
CardPanel cardPanel = makePanel(permanent, gameId, loadImage, callback, false, dimension);
|
||||
boolean implemented = permanent.getRarity() != Rarity.NA;
|
||||
cardPanel.setShowCastingCost(implemented);
|
||||
cardPanel.setShowCastingCost(true);
|
||||
return cardPanel;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MagePermanent getMageCard(CardView cardView, Dimension dimension, UUID gameId, ActionCallback callback, boolean canBeFoil, boolean loadImage) {
|
||||
CardPanel cardPanel = makePanel(cardView, gameId, loadImage, callback, false, dimension);
|
||||
boolean implemented = cardView.getRarity() != null && cardView.getRarity() != Rarity.NA;
|
||||
cardPanel.setShowCastingCost(implemented);
|
||||
cardPanel.setShowCastingCost(true);
|
||||
return cardPanel;
|
||||
}
|
||||
|
||||
|
|
|
@ -512,7 +512,7 @@ public class CardView extends SimpleCardView {
|
|||
}
|
||||
if (this.rarity == null && object instanceof StackAbility) {
|
||||
StackAbility stackAbility = (StackAbility) object;
|
||||
this.rarity = Rarity.NA;
|
||||
this.rarity = Rarity.SPECIAL;
|
||||
this.rules = new ArrayList<>();
|
||||
this.rules.add(stackAbility.getRule());
|
||||
if (stackAbility.getZone() == Zone.COMMAND) {
|
||||
|
@ -644,7 +644,7 @@ public class CardView extends SimpleCardView {
|
|||
this.frameColor = token.getFrameColor(null);
|
||||
this.frameStyle = token.getFrameStyle();
|
||||
this.manaCost = token.getManaCost().getSymbols();
|
||||
this.rarity = Rarity.NA;
|
||||
this.rarity = Rarity.SPECIAL;
|
||||
this.type = token.getTokenType();
|
||||
this.tokenDescriptor = token.getTokenDescriptor();
|
||||
this.tokenSetCode = token.getOriginalExpansionSetCode();
|
||||
|
|
|
@ -283,7 +283,7 @@ public class MorphAbility extends StaticAbility implements AlternativeSourceCost
|
|||
mageObject.getManaCost().clear();
|
||||
if (mageObject instanceof Permanent) {
|
||||
((Permanent) mageObject).setExpansionSetCode("");
|
||||
((Permanent) mageObject).setRarity(Rarity.NA);
|
||||
((Permanent) mageObject).setRarity(Rarity.SPECIAL);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,7 +6,6 @@ package mage.constants;
|
|||
*/
|
||||
public enum Rarity {
|
||||
|
||||
NA ("na", "na", "N", 0),
|
||||
LAND ("Land", "common", "C", 1),
|
||||
COMMON ("Common", "common", "C", 1),
|
||||
UNCOMMON ("Uncommon", "uncommon", "U", 2),
|
||||
|
|
Loading…
Reference in a new issue