mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 11:32:00 -08:00
remove helper functions from cardUtil
This commit is contained in:
parent
314316f42f
commit
1649530e7b
6 changed files with 16 additions and 27 deletions
|
|
@ -42,7 +42,6 @@ import mage.client.util.GUISizeHelper;
|
|||
import mage.client.util.audio.AudioManager;
|
||||
import mage.client.util.layout.CardLayoutStrategy;
|
||||
import mage.client.util.layout.impl.OldCardLayoutStrategy;
|
||||
import mage.utils.CardUtil;
|
||||
import mage.view.CounterView;
|
||||
import mage.view.PermanentView;
|
||||
|
||||
|
|
@ -155,7 +154,7 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
changed = true;
|
||||
} else {
|
||||
if (!changed) {
|
||||
changed = CardUtil.isCreature(oldMagePermanent.getOriginalPermanent()) != CardUtil.isCreature(permanent);
|
||||
changed = oldMagePermanent.getOriginalPermanent().isCreature() != permanent.isCreature();
|
||||
if (!changed) {
|
||||
int s1 = permanent.getAttachments() == null ? 0 : permanent.getAttachments().size();
|
||||
int s2 = oldMagePermanent.getLinks().size();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ package mage.client.util.gui;
|
|||
import mage.client.MageFrame;
|
||||
import mage.client.util.GUISizeHelper;
|
||||
import mage.constants.*;
|
||||
import mage.utils.CardUtil;
|
||||
import mage.view.CardView;
|
||||
import mage.view.CounterView;
|
||||
import mage.view.PermanentView;
|
||||
|
|
@ -269,9 +268,9 @@ public final class GuiDisplayUtil {
|
|||
buffer.append("</td></tr></table>");
|
||||
|
||||
String pt = "";
|
||||
if (CardUtil.isCreature(card)) {
|
||||
if (card.isCreature()) {
|
||||
pt = card.getPower() + '/' + card.getToughness();
|
||||
} else if (CardUtil.isPlaneswalker(card)) {
|
||||
} else if (card.isPlanesWalker()) {
|
||||
pt = card.getLoyalty();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import mage.client.util.ImageHelper;
|
|||
import mage.components.ImagePanel;
|
||||
import mage.components.ImagePanelStyle;
|
||||
import mage.constants.AbilityType;
|
||||
import mage.utils.CardUtil;
|
||||
import mage.view.CardView;
|
||||
import mage.view.CounterView;
|
||||
import mage.view.PermanentView;
|
||||
|
|
@ -232,9 +231,9 @@ public class CardPanelComponentImpl extends CardPanel {
|
|||
|
||||
// PT Text
|
||||
ptText = new GlowText();
|
||||
if (CardUtil.isCreature(gameCard)) {
|
||||
if (gameCard.isCreature()) {
|
||||
ptText.setText(gameCard.getPower() + '/' + gameCard.getToughness());
|
||||
} else if (CardUtil.isPlaneswalker(gameCard)) {
|
||||
} else if (gameCard.isPlanesWalker()) {
|
||||
ptText.setText(gameCard.getLoyalty());
|
||||
}
|
||||
// ptText.setFont(getFont().deriveFont(Font.BOLD, fontSize));
|
||||
|
|
@ -424,7 +423,7 @@ public class CardPanelComponentImpl extends CardPanel {
|
|||
imagePanel.setLocation(cardXOffset + borderSize, cardYOffset + borderSize);
|
||||
imagePanel.setSize(cardWidth - borderSize * 2, cardHeight - borderSize * 2);
|
||||
|
||||
if (hasSickness() && CardUtil.isCreature(gameCard) && isPermanent()) {
|
||||
if (hasSickness() && gameCard.isCreature() && isPermanent()) {
|
||||
overlayPanel.setLocation(cardXOffset + borderSize, cardYOffset + borderSize);
|
||||
overlayPanel.setSize(cardWidth - borderSize * 2, cardHeight - borderSize * 2);
|
||||
} else {
|
||||
|
|
@ -571,11 +570,11 @@ public class CardPanelComponentImpl extends CardPanel {
|
|||
super.update(card);
|
||||
|
||||
// Update card text
|
||||
if (CardUtil.isCreature(card) && CardUtil.isPlaneswalker(card)) {
|
||||
if (card.isCreature() && card.isPlanesWalker()) {
|
||||
ptText.setText(card.getPower() + '/' + card.getToughness() + " (" + card.getLoyalty() + ')');
|
||||
} else if (CardUtil.isCreature(card)) {
|
||||
} else if (card.isCreature()) {
|
||||
ptText.setText(card.getPower() + '/' + card.getToughness());
|
||||
} else if (CardUtil.isPlaneswalker(card)) {
|
||||
} else if (card.isPlanesWalker()) {
|
||||
ptText.setText(card.getLoyalty());
|
||||
} else {
|
||||
ptText.setText("");
|
||||
|
|
@ -583,7 +582,7 @@ public class CardPanelComponentImpl extends CardPanel {
|
|||
setText(card);
|
||||
|
||||
// Summoning Sickness overlay
|
||||
if (hasSickness() && CardUtil.isCreature(gameCard) && isPermanent()) {
|
||||
if (hasSickness() && card.isCreature() && isPermanent()) {
|
||||
overlayPanel.setVisible(true);
|
||||
} else {
|
||||
overlayPanel.setVisible(false);
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ import mage.client.dialog.PreferencesDialog;
|
|||
import mage.constants.AbilityType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.utils.CardUtil;
|
||||
import mage.view.CardView;
|
||||
import mage.view.CounterView;
|
||||
import mage.view.PermanentView;
|
||||
|
|
@ -236,7 +235,7 @@ public abstract class CardRenderer {
|
|||
|
||||
// Draw summoning sickness overlay, and possibly other overlays
|
||||
protected void drawOverlays(Graphics2D g) {
|
||||
if (CardUtil.isCreature(cardView) && cardView instanceof PermanentView) {
|
||||
if (cardView.isCreature() && cardView instanceof PermanentView) {
|
||||
if (((PermanentView) cardView).hasSummoningSickness()) {
|
||||
int x1 = (int) (0.2 * cardWidth);
|
||||
int x2 = (int) (0.8 * cardWidth);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue