mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
change enum equals to == for client
This commit is contained in:
parent
a32a02b688
commit
d966c82019
9 changed files with 17 additions and 17 deletions
|
@ -217,7 +217,7 @@ public class CardsList extends javax.swing.JPanel implements MouseListener, ICar
|
|||
|
||||
// if you use the deck ediot to build a free deck, numbers can be set directly in deck and sideboard
|
||||
public void setDeckEditorMode(DeckEditorMode mode) {
|
||||
if (mode.equals(DeckEditorMode.FREE_BUILDING)) {
|
||||
if (mode == DeckEditorMode.FREE_BUILDING) {
|
||||
// activate spinner for card number change
|
||||
mainModel.setNumberEditable(true);
|
||||
TableColumnModel tcm = mainTable.getColumnModel();
|
||||
|
|
|
@ -265,10 +265,10 @@ public class ChatPanelBasic extends javax.swing.JPanel {
|
|||
textColor = MESSAGE_COLOR;
|
||||
userSeparator = ": ";
|
||||
}
|
||||
if (color.equals(MessageColor.ORANGE)) {
|
||||
if (color == MessageColor.ORANGE) {
|
||||
textColor = "Orange";
|
||||
}
|
||||
if (color.equals(MessageColor.YELLOW)) {
|
||||
if (color == MessageColor.YELLOW) {
|
||||
textColor = "Yellow";
|
||||
}
|
||||
if (messageType == MessageType.WHISPER_FROM) {
|
||||
|
@ -361,7 +361,7 @@ public class ChatPanelBasic extends javax.swing.JPanel {
|
|||
this.txtConversation.setExtBackgroundColor(new Color(0, 0, 0, alpha)); // Alpha = 255 not transparent
|
||||
this.txtConversation.setSelectionColor(Color.LIGHT_GRAY);
|
||||
this.jScrollPaneTxt.setOpaque(alpha == 255);
|
||||
this.jScrollPaneTxt.getViewport().setOpaque(!chatType.equals(ChatType.TABLES));
|
||||
this.jScrollPaneTxt.getViewport().setOpaque(chatType != ChatType.TABLES);
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
|
|
|
@ -241,7 +241,7 @@ public class MageBook extends JComponent {
|
|||
cardImg.update(card);
|
||||
cardImg.setCardBounds(rectangle.x, rectangle.y, cardDimensions.frameWidth, cardDimensions.frameHeight);
|
||||
|
||||
boolean implemented = !card.getRarity().equals(Rarity.NA);
|
||||
boolean implemented = card.getRarity() != Rarity.NA;
|
||||
|
||||
GlowText label = new GlowText();
|
||||
label.setGlow(implemented ? Color.green : NOT_IMPLEMENTED, 12, 0.0f);
|
||||
|
|
|
@ -109,7 +109,7 @@ public class ShowCardsDialog extends MageDialog {
|
|||
java.util.List<UUID> choosableCards = (java.util.List<UUID>) options.get("choosable");
|
||||
cardArea.markCards(choosableCards);
|
||||
}
|
||||
if (options.containsKey("queryType") && QueryType.PICK_ABILITY.equals(options.get("queryType"))) {
|
||||
if (options.containsKey("queryType") && options.get("queryType") == QueryType.PICK_ABILITY) {
|
||||
cardArea.setPopupMenu(popupMenu);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -296,7 +296,7 @@ public final class GuiDisplayUtil {
|
|||
buffer.append("[only controlled] ");
|
||||
}
|
||||
}
|
||||
if (!card.getMageObjectType().equals(MageObjectType.NULL)) {
|
||||
if (card.getMageObjectType() != MageObjectType.NULL) {
|
||||
buffer.append(card.getMageObjectType().toString());
|
||||
}
|
||||
buffer.append("</td></tr></table>");
|
||||
|
|
|
@ -72,12 +72,12 @@ public final class ConstructedFormats {
|
|||
underlyingSetCodesPerFormat.get(set.getName()).add(set.getCode());
|
||||
|
||||
// create the play formats
|
||||
if (set.getType().equals(SetType.CUSTOM_SET)) {
|
||||
if (set.getType() == SetType.CUSTOM_SET) {
|
||||
underlyingSetCodesPerFormat.get(CUSTOM).add(set.getCode());
|
||||
continue;
|
||||
}
|
||||
underlyingSetCodesPerFormat.get(VINTAGE_LEGACY).add(set.getCode());
|
||||
if (set.getType().equals(SetType.CORE) || set.getType().equals(SetType.EXPANSION) || set.getType().equals(SetType.SUPPLEMENTAL_STANDARD_LEGAL)) {
|
||||
if (set.getType() == SetType.CORE || set.getType() == SetType.EXPANSION || set.getType() == SetType.SUPPLEMENTAL_STANDARD_LEGAL) {
|
||||
if (STANDARD_CARDS.getSetCodes().contains(set.getCode())) {
|
||||
underlyingSetCodesPerFormat.get(STANDARD).add(set.getCode());
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public final class ConstructedFormats {
|
|||
}
|
||||
|
||||
// Create the Block formats
|
||||
if (set.getType().equals(SetType.EXPANSION) && set.getBlockName() != null) {
|
||||
if (set.getType() == SetType.EXPANSION && set.getBlockName() != null) {
|
||||
String blockDisplayName = getBlockDisplayName(set.getBlockName());
|
||||
underlyingSetCodesPerFormat.computeIfAbsent(blockDisplayName, k -> new ArrayList<>());
|
||||
|
||||
|
@ -110,7 +110,7 @@ public final class ConstructedFormats {
|
|||
|
||||
}
|
||||
|
||||
if (set.getType().equals(SetType.SUPPLEMENTAL) && set.getBlockName() != null) {
|
||||
if (set.getType() == SetType.SUPPLEMENTAL && set.getBlockName() != null) {
|
||||
expansionInfo.putIfAbsent(set.getBlockName(), set);
|
||||
|
||||
if (expansionInfo.get(set.getBlockName()).getReleaseDate().before(set.getReleaseDate())) {
|
||||
|
|
|
@ -205,9 +205,9 @@ public class CardPanelComponentImpl extends CardPanel {
|
|||
|
||||
// Ability icon
|
||||
if (newGameCard.isAbility()) {
|
||||
if (AbilityType.TRIGGERED.equals(newGameCard.getAbilityType())) {
|
||||
if (newGameCard.getAbilityType() == AbilityType.TRIGGERED) {
|
||||
setTypeIcon(ImageManagerImpl.getInstance().getTriggeredAbilityImage(), "Triggered Ability");
|
||||
} else if (AbilityType.ACTIVATED.equals(newGameCard.getAbilityType())) {
|
||||
} else if (newGameCard.getAbilityType() == AbilityType.ACTIVATED) {
|
||||
setTypeIcon(ImageManagerImpl.getInstance().getActivatedAbilityImage(), "Activated Ability");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -367,9 +367,9 @@ public abstract class CardRenderer {
|
|||
// Get a string representing the type line
|
||||
protected String getCardTypeLine() {
|
||||
if (cardView.isAbility()) {
|
||||
if (AbilityType.TRIGGERED.equals(cardView.getAbilityType())) {
|
||||
if (cardView.getAbilityType() == AbilityType.TRIGGERED) {
|
||||
return "Triggered Ability";
|
||||
} else if (AbilityType.ACTIVATED.equals(cardView.getAbilityType())) {
|
||||
} else if (cardView.getAbilityType() == AbilityType.ACTIVATED) {
|
||||
return "Activated Ability";
|
||||
} else if (cardView.getAbilityType() == null) {
|
||||
// TODO: Triggered abilities waiting to be put onto the stack have abilityType = null. Figure out why
|
||||
|
|
|
@ -125,7 +125,7 @@ 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().equals(Rarity.NA);
|
||||
boolean implemented = permanent.getRarity() != Rarity.NA;
|
||||
cardPanel.setShowCastingCost(implemented);
|
||||
return cardPanel;
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public class CardPluginImpl implements CardPlugin {
|
|||
@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().equals(Rarity.NA);
|
||||
boolean implemented = cardView.getRarity() != null && cardView.getRarity() != Rarity.NA;
|
||||
cardPanel.setShowCastingCost(implemented);
|
||||
return cardPanel;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue