mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
Merge branch 'constants-refactor'
This commit is contained in:
commit
1d4b3a2be6
7381 changed files with 28780 additions and 27680 deletions
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
package mage.client.cards;
|
||||
|
||||
import mage.Constants.CardType;
|
||||
import mage.constants.CardType;
|
||||
import mage.cards.CardDimensions;
|
||||
import mage.cards.MagePermanent;
|
||||
import mage.cards.TextPopup;
|
||||
|
|
@ -264,7 +264,7 @@ public class Card extends MagePermanent implements MouseMotionListener, MouseLis
|
|||
sbType.append(superType).append(" ");
|
||||
}
|
||||
|
||||
for (mage.Constants.CardType cardType: card.getCardTypes()) {
|
||||
for (CardType cardType: card.getCardTypes()) {
|
||||
sbType.append(cardType.toString()).append(" ");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ import java.util.List;
|
|||
import java.util.UUID;
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.DefaultTableCellRenderer;
|
||||
import mage.Constants.CardType;
|
||||
import mage.constants.CardType;
|
||||
import mage.cards.MageCard;
|
||||
import mage.client.constants.Constants.SortBy;
|
||||
import mage.client.deckeditor.table.TableModel;
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import java.util.UUID;
|
|||
|
||||
import javax.swing.PopupFactory;
|
||||
|
||||
import mage.Constants.CardType;
|
||||
import mage.constants.CardType;
|
||||
import mage.cards.CardDimensions;
|
||||
import mage.cards.MagePermanent;
|
||||
import mage.client.util.Config;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package mage.client.deck.generator;
|
||||
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.ColoredManaSymbol;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ColoredManaSymbol;
|
||||
import mage.Mana;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.decks.Deck;
|
||||
|
|
@ -11,6 +11,7 @@ import mage.cards.repository.CardRepository;
|
|||
import mage.client.MageFrame;
|
||||
import mage.client.util.gui.ColorsChooser;
|
||||
import mage.client.util.sets.ConstructedFormats;
|
||||
import mage.constants.Rarity;
|
||||
import mage.interfaces.rate.RateCallback;
|
||||
import mage.cards.Sets;
|
||||
import mage.utils.DeckBuilder;
|
||||
|
|
@ -26,7 +27,7 @@ import java.util.LinkedList;
|
|||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
import mage.Constants;
|
||||
|
||||
import mage.cards.ExpansionSet;
|
||||
|
||||
/**
|
||||
|
|
@ -369,7 +370,7 @@ public class DeckGenerator {
|
|||
if (!landSets.isEmpty()) {
|
||||
criteria.setCodes(landSets.toArray(new String[landSets.size()]));
|
||||
}
|
||||
criteria.rarities(Constants.Rarity.LAND).name(cardName);
|
||||
criteria.rarities(Rarity.LAND).name(cardName);
|
||||
List<CardInfo> cards = CardRepository.instance.findCards(criteria);
|
||||
|
||||
if (cards.isEmpty() && !setsToUse.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
package mage.client.deckeditor;
|
||||
|
||||
import mage.Constants.CardType;
|
||||
import mage.constants.CardType;
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
import mage.cards.Card;
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ import mage.client.util.Config;
|
|||
import mage.client.util.ImageHelper;
|
||||
import mage.client.util.sets.ConstructedFormats;
|
||||
import mage.components.ImagePanel;
|
||||
import mage.constants.Rarity;
|
||||
import mage.view.CardView;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.mage.card.arcane.GlowText;
|
||||
|
|
@ -254,7 +255,7 @@ public class MageBook extends JComponent {
|
|||
cardImg.update(card);
|
||||
cardImg.setCardBounds(rectangle.x, rectangle.y, cardDimensions.frameWidth, cardDimensions.frameHeight);
|
||||
|
||||
boolean implemented = !card.getRarity().equals(mage.Constants.Rarity.NA);
|
||||
boolean implemented = !card.getRarity().equals(Rarity.NA);
|
||||
|
||||
GlowText label = new GlowText();
|
||||
label.setGlow(implemented ? Color.green : NOT_IMPLEMENTED, 12, 0.0f);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
package mage.client.deckeditor.table;
|
||||
|
||||
import mage.Constants.CardType;
|
||||
import mage.constants.CardType;
|
||||
import mage.cards.MageCard;
|
||||
import mage.view.CardView;
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
package mage.client.deckeditor.table;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.cards.CardEventSource;
|
||||
|
|
@ -40,6 +39,7 @@ import mage.client.util.Event;
|
|||
import mage.client.util.ImageHelper;
|
||||
import mage.client.util.Listener;
|
||||
import mage.client.util.gui.GuiDisplayUtil;
|
||||
import mage.constants.CardType;
|
||||
import mage.view.CardView;
|
||||
import mage.view.CardsView;
|
||||
import org.apache.log4j.Logger;
|
||||
|
|
@ -93,9 +93,9 @@ public class TableModel extends AbstractTableModel implements ICardGrid {
|
|||
addCard(card, bigCard, gameId);
|
||||
}
|
||||
if (updateCountsCallback != null) {
|
||||
if (card.getCardTypes().contains(Constants.CardType.LAND))
|
||||
if (card.getCardTypes().contains(CardType.LAND))
|
||||
landCount++;
|
||||
if (card.getCardTypes().contains(Constants.CardType.CREATURE))
|
||||
if (card.getCardTypes().contains(CardType.CREATURE))
|
||||
creatureCount++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,21 +25,12 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
/*
|
||||
* AddLandDialog.java
|
||||
*
|
||||
* Created on Jan 11, 2011, 1:20:45 PM
|
||||
*/
|
||||
|
||||
package mage.client.dialog;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import javax.swing.JLayeredPane;
|
||||
import mage.Constants;
|
||||
import mage.Mana;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.Sets;
|
||||
|
|
@ -48,6 +39,7 @@ import mage.cards.repository.CardCriteria;
|
|||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.client.MageFrame;
|
||||
import mage.constants.Rarity;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -80,7 +72,7 @@ public class AddLandDialog extends MageDialog {
|
|||
if (!setCodesland.isEmpty()) {
|
||||
criteria.setCodes(setCodesland.toArray(new String[setCodesland.size()]));
|
||||
}
|
||||
criteria.rarities(Constants.Rarity.LAND).name(landName);
|
||||
criteria.rarities(Rarity.LAND).name(landName);
|
||||
List<CardInfo> cards = CardRepository.instance.findCards(criteria);
|
||||
if (cards.isEmpty()) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.swing.*;
|
||||
import mage.Constants.MultiplayerAttackOption;
|
||||
import mage.Constants.RangeOfInfluence;
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.cards.decks.importer.DeckImporterUtil;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.components.MageComponents;
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ import javax.swing.DefaultComboBoxModel;
|
|||
import javax.swing.JComboBox;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.SpinnerNumberModel;
|
||||
import mage.Constants.MultiplayerAttackOption;
|
||||
import mage.Constants.RangeOfInfluence;
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.cards.Sets;
|
||||
import mage.client.MageFrame;
|
||||
|
|
|
|||
|
|
@ -34,13 +34,13 @@
|
|||
|
||||
package mage.client.game;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.cards.MagePermanent;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.cards.Permanent;
|
||||
import mage.client.plugins.impl.Plugins;
|
||||
import mage.client.util.AudioManager;
|
||||
import mage.client.util.Config;
|
||||
import mage.constants.CardType;
|
||||
import mage.view.PermanentView;
|
||||
|
||||
import javax.swing.*;
|
||||
|
|
@ -209,9 +209,9 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
}*/
|
||||
}
|
||||
|
||||
if (permanent.getCardTypes().contains(Constants.CardType.ARTIFACT)) {
|
||||
if (permanent.getCardTypes().contains(CardType.ARTIFACT)) {
|
||||
addedArtifact = true;
|
||||
} else if (permanent.getCardTypes().contains(Constants.CardType.CREATURE)) {
|
||||
} else if (permanent.getCardTypes().contains(CardType.CREATURE)) {
|
||||
addedCreature = true;
|
||||
} else {
|
||||
addedPermanent = true;
|
||||
|
|
@ -274,7 +274,7 @@ public class BattlefieldPanel extends javax.swing.JLayeredPane {
|
|||
});
|
||||
t.start();
|
||||
}
|
||||
if (((MagePermanent)comp).getOriginal().getCardTypes().contains(Constants.CardType.CREATURE)) {
|
||||
if (((MagePermanent)comp).getOriginal().getCardTypes().contains(CardType.CREATURE)) {
|
||||
removedCreature = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
*/
|
||||
package mage.client.game;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.cards.action.ActionCallback;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.cards.BigCard;
|
||||
|
|
@ -45,6 +44,7 @@ import mage.client.util.Config;
|
|||
import mage.client.util.GameManager;
|
||||
import mage.client.util.PhaseManager;
|
||||
import mage.client.util.gui.ArrowBuilder;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.remote.Session;
|
||||
import mage.view.*;
|
||||
import org.apache.log4j.Logger;
|
||||
|
|
@ -504,7 +504,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
/**
|
||||
* Update phase buttons\labels.
|
||||
*/
|
||||
private void updatePhases(Constants.PhaseStep step) {
|
||||
private void updatePhases(PhaseStep step) {
|
||||
if (step == null) {
|
||||
logger.warn("step is null");
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
package mage.client.game;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.cards.BigCard;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import mage.client.util.Config;
|
||||
import mage.constants.Zone;
|
||||
import mage.view.SimpleCardsView;
|
||||
|
||||
import javax.swing.*;
|
||||
|
|
@ -55,7 +55,7 @@ public class HandPanel extends JPanel {
|
|||
hand.setBackgroundColor(new Color(0, 0, 0, 100));
|
||||
hand.setVisibleIfEmpty(false);
|
||||
hand.setBorder(emptyBorder);
|
||||
hand.setZone(Constants.Zone.HAND.toString());
|
||||
hand.setZone(Zone.HAND.toString());
|
||||
}
|
||||
|
||||
public void loadCards(SimpleCardsView cards, BigCard bigCard, UUID gameId) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package mage.client.plugins.adapters;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.cards.MageCard;
|
||||
import mage.cards.MagePermanent;
|
||||
import mage.cards.action.ActionCallback;
|
||||
|
|
@ -17,6 +16,7 @@ import mage.client.util.ImageHelper;
|
|||
import mage.client.util.gui.ArrowBuilder;
|
||||
import mage.client.util.gui.GuiDisplayUtil;
|
||||
import mage.components.CardInfoPane;
|
||||
import mage.constants.Rarity;
|
||||
import mage.remote.Session;
|
||||
import mage.utils.ThreadUtils;
|
||||
import mage.view.CardView;
|
||||
|
|
@ -195,7 +195,7 @@ public class MageActionCallback implements ActionCallback {
|
|||
|
||||
private void showPopup(final TransferData data, final Component parentComponent, final Point parentPoint) {
|
||||
// skip popup for not implemented cards (they have Rarity.NA)
|
||||
if (data.card.getRarity().equals(Constants.Rarity.NA)) {
|
||||
if (data.card.getRarity().equals(Rarity.NA)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@ import java.util.concurrent.CancellationException;
|
|||
import java.util.concurrent.ExecutionException;
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
import mage.Constants.MultiplayerAttackOption;
|
||||
import mage.Constants.RangeOfInfluence;
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.cards.decks.importer.DeckImporterUtil;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.chat.ChatPanel;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import javax.swing.JButton;
|
|||
import javax.swing.JLabel;
|
||||
import javax.swing.SwingConstants;
|
||||
|
||||
import mage.Constants.CardType;
|
||||
import mage.constants.CardType;
|
||||
import mage.utils.CardUtil;
|
||||
import mage.view.CardView;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package org.mage.card.arcane;
|
||||
|
||||
import mage.Constants.CardType;
|
||||
import mage.constants.CardType;
|
||||
import mage.cards.MagePermanent;
|
||||
import mage.cards.TextPopup;
|
||||
import mage.cards.action.ActionCallback;
|
||||
|
|
@ -751,7 +751,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
sbType.append(superType).append(" ");
|
||||
}
|
||||
|
||||
for (mage.Constants.CardType cardType : card.getCardTypes()) {
|
||||
for (CardType cardType : card.getCardTypes()) {
|
||||
sbType.append(cardType.toString()).append(" ");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package org.mage.plugins.card;
|
|||
|
||||
import mage.cards.MagePermanent;
|
||||
import mage.cards.action.ActionCallback;
|
||||
import mage.constants.Rarity;
|
||||
import mage.interfaces.plugin.CardPlugin;
|
||||
import mage.utils.CardUtil;
|
||||
import mage.view.CardView;
|
||||
|
|
@ -80,7 +81,7 @@ public class CardPluginImpl implements CardPlugin {
|
|||
boolean foil = canBeFoil && (new Random()).nextInt(5) == 0;
|
||||
CardPanel cardPanel = new CardPanel(permanent, gameId, loadImage, callback, foil);
|
||||
cardPanel.setCardBounds(0, 0, dimension.width, dimension.height);
|
||||
boolean implemented = !permanent.getRarity().equals(mage.Constants.Rarity.NA);
|
||||
boolean implemented = !permanent.getRarity().equals(Rarity.NA);
|
||||
cardPanel.setShowCastingCost(implemented);
|
||||
return cardPanel;
|
||||
}
|
||||
|
|
@ -90,7 +91,7 @@ public class CardPluginImpl implements CardPlugin {
|
|||
boolean foil = canBeFoil && (new Random()).nextInt(5) == 0;
|
||||
CardPanel cardPanel = new CardPanel(permanent, gameId, loadImage, callback, foil);
|
||||
cardPanel.setCardBounds(0, 0, dimension.width, dimension.height);
|
||||
boolean implemented = !permanent.getRarity().equals(mage.Constants.Rarity.NA);
|
||||
boolean implemented = !permanent.getRarity().equals(Rarity.NA);
|
||||
cardPanel.setShowCastingCost(implemented);
|
||||
return cardPanel;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package org.mage.plugins.card.info;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.components.CardInfoPane;
|
||||
import mage.constants.CardType;
|
||||
import mage.utils.CardUtil;
|
||||
import mage.utils.ThreadUtils;
|
||||
import mage.view.CardView;
|
||||
|
|
@ -14,7 +14,6 @@ import javax.swing.*;
|
|||
import java.awt.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import mage.abilities.SpellAbility;
|
||||
|
||||
/**
|
||||
* Card info pane for displaying card rules.
|
||||
|
|
@ -263,7 +262,7 @@ public class CardInfoPaneImpl extends JEditorPane implements CardInfoPane {
|
|||
for (String superType : card.getSuperTypes()) {
|
||||
types += superType + " ";
|
||||
}
|
||||
for (Constants.CardType cardType : card.getCardTypes()) {
|
||||
for (CardType cardType : card.getCardTypes()) {
|
||||
types += cardType.toString() + " ";
|
||||
}
|
||||
if (card.getSubTypes().size() > 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue