change enum equals to == for client

This commit is contained in:
ingmargoudt 2017-03-01 17:03:11 +01:00
parent a32a02b688
commit d966c82019
9 changed files with 17 additions and 17 deletions

View file

@ -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();

View file

@ -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() {

View file

@ -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);

View file

@ -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);
}
}

View file

@ -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>");

View file

@ -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())) {

View file

@ -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");
}
}

View file

@ -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

View file

@ -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;
}