All final strings became static - it will give a little perfomance boost, due to not instantiating same string every time

This commit is contained in:
vraskulin 2017-02-27 16:33:32 +03:00
parent 26ce8e0bcc
commit af3986df46
46 changed files with 56 additions and 56 deletions

View file

@ -26,7 +26,7 @@ public class MageRoundPane extends JPanel {
private int Y_OFFSET = 30;
private final Color defaultBackgroundColor = new Color(141, 130, 112, 200);
private Color backgroundColor = defaultBackgroundColor;
private final int alpha = 0;
private static final int alpha = 0;
private static final Map<ShadowKey, BufferedImage> SHADOW_IMAGE_CACHE;
private static final Map<Key, BufferedImage> IMAGE_CACHE;

View file

@ -16,7 +16,7 @@ public class BackgroundPainter extends AbstractPainter {
private final Color bgColor = Color.black;
final float bgalpha = 0.6f;
static final float bgalpha = 0.6f;
public BackgroundPainter() {
super();

View file

@ -22,7 +22,7 @@ public class DialogContainer extends JPanel {
private Color backgroundColor = new Color(0, 255, 255, 60);
private int alpha = 50;
private final boolean isGradient = false;
private static final boolean isGradient = false;
private final TexturePaint tp = null;
private final Image gradient = null;
private BufferedImage b;

View file

@ -62,7 +62,7 @@ public class DeckArea extends javax.swing.JPanel {
private BigCard lastBigCard = null;
private int dividerLocationNormal = 0;
private int dividerLocationLimited = 0;
private final boolean isLimitedBuildingOrientation = false;
private static final boolean isLimitedBuildingOrientation = false;
public DeckCardLayout getCardLayout() {
return deckList.getCardLayout();

View file

@ -86,8 +86,8 @@ public class NewTournamentDialog extends MageDialog {
private JTextArea txtRandomPacks;
private final List<TournamentPlayerPanel> players = new ArrayList<>();
private final List<JComboBox> packs = new ArrayList<>();
private final int CONSTRUCTION_TIME_MIN = 6;
private final int CONSTRUCTION_TIME_MAX = 30;
private static final int CONSTRUCTION_TIME_MIN = 6;
private static final int CONSTRUCTION_TIME_MAX = 30;
private boolean isRandom = false;
private boolean isRichMan = false;
private String cubeFromDeckFilename = "";

View file

@ -68,12 +68,12 @@ public class CardPluginImpl implements CardPlugin {
private static final float STACK_SPACING_Y = 0.10f;
private static final float ATTACHMENT_SPACING_Y = 0.13f;
private final int landStackMax = 5;
private static final int landStackMax = 5;
// private int cardWidthMin = 50, cardWidthMax = Constants.CARD_SIZE_FULL.width;
private int cardWidthMin = (int) GUISizeHelper.battlefieldCardMinDimension.getWidth();
private int cardWidthMax = (int) GUISizeHelper.battlefieldCardMaxDimension.getWidth();
private final boolean stackVertical = false;
private static final boolean stackVertical = false;
private int playAreaWidth, playAreaHeight;
private int cardWidth, cardHeight;

View file

@ -59,7 +59,7 @@ public class AbzanBattlePriest extends CardImpl {
filter.add(new CounterPredicate(CounterType.P1P1));
}
final String rule = "Each creature you control with a +1/+1 counter on it has lifelink";
static final String rule = "Each creature you control with a +1/+1 counter on it has lifelink";
public AbzanBattlePriest(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}");

View file

@ -60,7 +60,7 @@ public class AinokBondKin extends CardImpl {
filter.add(new CounterPredicate(CounterType.P1P1));
}
final String rule = "Each creature you control with a +1/+1 counter on it has first strike";
static final String rule = "Each creature you control with a +1/+1 counter on it has first strike";
public AinokBondKin(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{W}");

View file

@ -84,8 +84,8 @@ public class AquamorphEntity extends CardImpl {
class AquamorphEntityReplacementEffect extends ReplacementEffectImpl {
private final String choice51 = "a 5/1 creature";
private final String choice15 = "a 1/5 creature";
private static final String choice51 = "a 5/1 creature";
private static final String choice15 = "a 1/5 creature";
public AquamorphEntityReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);

View file

@ -64,7 +64,7 @@ public class Aurification extends CardImpl {
filter.add(new CounterPredicate(CounterType.GOLD));
}
final String rule = "Each creature with a gold counter on it is a Wall in addition to its other creature types and has defender.";
static final String rule = "Each creature with a gold counter on it is a Wall in addition to its other creature types and has defender.";
public Aurification(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}{W}");

View file

@ -47,7 +47,7 @@ import mage.counters.CounterType;
*/
public class BalothPup extends CardImpl {
private final String rule = "{this} has trample as long as it has a +1/+1 counter on it";
private static final String rule = "{this} has trample as long as it has a +1/+1 counter on it";
public BalothPup(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{1}{G}");

View file

@ -47,7 +47,7 @@ import mage.cards.CardSetInfo;
*/
public class BladeTribeBerserkers extends CardImpl {
private final String effectText = "Metalcraft - When Blade-Tribe Berserkers enters the battlefield, if you control three or more artifacts, Blade-Tribe Berserkers gets +3/+3 and gains haste until end of turn.";
private static final String effectText = "Metalcraft - When Blade-Tribe Berserkers enters the battlefield, if you control three or more artifacts, Blade-Tribe Berserkers gets +3/+3 and gains haste until end of turn.";
public BladeTribeBerserkers(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}");

View file

@ -47,7 +47,7 @@ import mage.target.TargetPlayer;
*/
public class BleakCovenVampires extends CardImpl {
private final String effectText = "Metalcraft - When Bleak Coven Vampires enters the battlefield, if you control three or more artifacts, target player loses 4 life and you gain 4 life.";
private static final String effectText = "Metalcraft - When Bleak Coven Vampires enters the battlefield, if you control three or more artifacts, target player loses 4 life and you gain 4 life.";
public BleakCovenVampires(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{B}{B}");

View file

@ -51,7 +51,7 @@ import mage.filter.predicate.permanent.AnotherPredicate;
*/
public class CrabappleCohort extends CardImpl {
private final String rule = "{this} gets +1/+1 as long as you control another green creature";
private static final String rule = "{this} gets +1/+1 as long as you control another green creature";
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();

View file

@ -50,7 +50,7 @@ import mage.filter.predicate.permanent.AnotherPredicate;
*/
public class EldraziAggressor extends CardImpl {
private final String rule = "{this} has haste as long as you control another colorless creature";
private static final String rule = "{this} has haste as long as you control another colorless creature";
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another colorless creature");
static {

View file

@ -62,7 +62,7 @@ public class ExavaRakdosBloodWitch extends CardImpl {
filter.add(new AnotherPredicate());
}
final String rule = "Each other creature you control with a +1/+1 counter on it has haste";
static final String rule = "Each other creature you control with a +1/+1 counter on it has haste";
public ExavaRakdosBloodWitch(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{B}{R}");
this.supertype.add("Legendary");

View file

@ -49,7 +49,7 @@ import mage.cards.CardSetInfo;
* @author Loki
*/
public class EzurisBrigade extends CardImpl {
private final String text = "Metalcraft - As long as you control three or more artifacts, Ezuri's Brigade gets +4/+4 and has trample";
private static final String text = "Metalcraft - As long as you control three or more artifacts, Ezuri's Brigade gets +4/+4 and has trample";
public EzurisBrigade (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{G}");

View file

@ -42,7 +42,7 @@ import mage.target.common.TargetCreatureOrPlayer;
*/
public class GalvanicBlast extends CardImpl {
private final String effectText = "{this} deals 2 damage to target creature or player.<br>Metalcraft - {this} deals 4 damage to that creature or player instead if you control three or more artifacts";
private static final String effectText = "{this} deals 2 damage to target creature or player.<br>Metalcraft - {this} deals 4 damage to that creature or player instead if you control three or more artifacts";
public GalvanicBlast(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{R}");

View file

@ -47,7 +47,7 @@ import mage.cards.CardSetInfo;
*/
public class GhalmasWarden extends CardImpl {
private final String text = "Metalcraft - Ghalma's Warden gets +2/+2 as long as you control three or more artifacts";
private static final String text = "Metalcraft - Ghalma's Warden gets +2/+2 as long as you control three or more artifacts";
public GhalmasWarden (UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{W}");

View file

@ -60,8 +60,8 @@ public class GwyllionHedgeMage extends CardImpl {
filter2.add(new SubtypePredicate("Swamp"));
}
private final String rule1 = "When {this} enters the battlefield, if you control two or more Plains, you may create a 1/1 white Kithkin Soldier creature token.";
private final String rule2 = "When {this} enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature.";
private static final String rule1 = "When {this} enters the battlefield, if you control two or more Plains, you may create a 1/1 white Kithkin Soldier creature token.";
private static final String rule2 = "When {this} enters the battlefield, if you control two or more Swamps, you may put a -1/-1 counter on target creature.";
public GwyllionHedgeMage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{W/B}");

View file

@ -50,7 +50,7 @@ import mage.counters.CounterType;
*/
public class HelixPinnacle extends CardImpl {
final String rule = "if there are 100 or more tower counters on Helix Pinnacle, you win the game";
static final String rule = "if there are 100 or more tower counters on Helix Pinnacle, you win the game";
public HelixPinnacle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{G}");

View file

@ -47,7 +47,7 @@ import mage.filter.common.FilterCreaturePermanent;
*/
public class JorKadeenThePrevailer extends CardImpl {
private final String effectText = "Metalcraft - Creatures you control get +3/+0 as long as you control three or more artifacts.";
private static final String effectText = "Metalcraft - Creatures you control get +3/+0 as long as you control three or more artifacts.";
public JorKadeenThePrevailer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}{W}");

View file

@ -89,7 +89,7 @@ public class MaliciousAffliction extends CardImpl {
class CopySourceSpellEffect extends OneShotEffect {
final String rule = "copy {this} and may choose a new target for the copy";
static final String rule = "copy {this} and may choose a new target for the copy";
public CopySourceSpellEffect() {
super(Outcome.Benefit);

View file

@ -50,7 +50,7 @@ import mage.filter.predicate.permanent.AnotherPredicate;
*/
public class MarkovCrusader extends CardImpl {
private final String rule = "{this} has haste as long as you control another Vampire";
private static final String rule = "{this} has haste as long as you control another Vampire";
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("another Vampire");
static {

View file

@ -60,9 +60,9 @@ public class MinotaurTactician extends CardImpl {
filterBlue.add(new ColorPredicate(ObjectColor.BLUE));
}
final private String ruleWhite = "{this} gets +1/+1 as long as you control another white creature";
static final private String ruleWhite = "{this} gets +1/+1 as long as you control another white creature";
final private String ruleBlue = "{this} gets +1/+1 as long as you control another white creature";
static final private String ruleBlue = "{this} gets +1/+1 as long as you control another white creature";
public MinotaurTactician(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{3}{R}");

View file

@ -44,7 +44,7 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class MirranMettle extends CardImpl {
private final String effectText = "Metalcraft - That creature gets +4/+4 until end of turn instead if you control three or more artifacts.";
private static final String effectText = "Metalcraft - That creature gets +4/+4 until end of turn instead if you control three or more artifacts.";
public MirranMettle(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{G}");

View file

@ -52,7 +52,7 @@ import mage.filter.predicate.permanent.AnotherPredicate;
*/
public class MudbrawlerCohort extends CardImpl {
private final String rule = "{this} gets +1/+1 as long as you control another red creature";
private static final String rule = "{this} gets +1/+1 as long as you control another red creature";
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();

View file

@ -45,7 +45,7 @@ import mage.target.common.TargetCreaturePermanent;
*/
public class Nefashu extends CardImpl {
final String rule = "Whenever Nefashu attacks, up to five target creatures each get -1/-1 until end of turn.";
static final String rule = "Whenever Nefashu attacks, up to five target creatures each get -1/-1 until end of turn.";
public Nefashu(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{4}{B}{B}");

View file

@ -58,7 +58,7 @@ public class OgreBattledriver extends CardImpl {
filter.add(new AnotherPredicate());
}
private final String rule = "Whenever another creature enters the battlefield under your control, that creature gets +2/+0 and gains haste until end of turn.";
private static final String rule = "Whenever another creature enters the battlefield under your control, that creature gets +2/+0 and gains haste until end of turn.";
public OgreBattledriver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}");

View file

@ -58,7 +58,7 @@ public class PathOfBravery extends CardImpl {
static {
filter.add(new ControllerPredicate(TargetController.YOU));
}
final String rule = "As long as your life total is greater than or equal to your starting life total, creatures you control get +1/+1";
static final String rule = "As long as your life total is greater than or equal to your starting life total, creatures you control get +1/+1";
public PathOfBravery(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{W}");

View file

@ -78,9 +78,9 @@ public class PrimalClay extends CardImpl {
class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl {
private final String choice33 = "a 3/3 artifact creature";
private final String choice22 = "a 2/2 artifact creature with flying";
private final String choice16 = "a 1/6 artifact creature with defender";
private static final String choice33 = "a 3/3 artifact creature";
private static final String choice22 = "a 2/2 artifact creature with flying";
private static final String choice16 = "a 1/6 artifact creature with defender";
public PrimalPlasmaReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);

View file

@ -55,7 +55,7 @@ public class PrimalForcemage extends CardImpl {
filter.add(new AnotherPredicate());
}
private final String rule = "Whenever another creature enters the battlefield under your control, that creature gets +3/+3 until end of turn.";
private static final String rule = "Whenever another creature enters the battlefield under your control, that creature gets +3/+3 until end of turn.";
public PrimalForcemage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}");

View file

@ -79,9 +79,9 @@ public class PrimalPlasma extends CardImpl {
class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl {
private final String choice33 = "a 3/3 creature";
private final String choice22 = "a 2/2 creature with flying";
private final String choice16 = "a 1/6 creature with defender";
private static final String choice33 = "a 3/3 creature";
private static final String choice22 = "a 2/2 creature with flying";
private static final String choice16 = "a 1/6 creature with defender";
public PrimalPlasmaReplacementEffect() {
super(Duration.WhileOnBattlefield, Outcome.Benefit);

View file

@ -49,7 +49,7 @@ import mage.target.common.TargetCreatureOrPlayer;
*/
public class RekindledFlame extends CardImpl {
final String rule = "if an opponent has no cards in hand, you may return Rekindled Flame from your graveyard to your hand";
static final String rule = "if an opponent has no cards in hand, you may return Rekindled Flame from your graveyard to your hand";
public RekindledFlame(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}{R}");

View file

@ -56,7 +56,7 @@ public class SapphireDrake extends CardImpl {
filter.add(new CounterPredicate(CounterType.P1P1));
}
final String rule = "Each creature you control with a +1/+1 counter on it has flying";
static final String rule = "Each creature you control with a +1/+1 counter on it has flying";
public SapphireDrake(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{5}{U}");

View file

@ -62,7 +62,7 @@ public class ScourgeOfValkas extends CardImpl {
filter2.add(new SubtypePredicate("Dragon"));
}
private final String rule = "Whenever {this} or another Dragon enters the battlefield under your control, it deals X damage to target creature or player, where X is the number of Dragons you control.";
private static final String rule = "Whenever {this} or another Dragon enters the battlefield under your control, it deals X damage to target creature or player, where X is the number of Dragons you control.";
public ScourgeOfValkas(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}{R}");

View file

@ -62,8 +62,8 @@ public class SelkieHedgeMage extends CardImpl {
filter3.add(new TappedPredicate());
}
private final String rule1 = "When {this} enters the battlefield, if you control two or more Forests, you may gain 3 life.";
private final String rule2 = "When {this} enters the battlefield, if you control two or more Islands, you may return target tapped creature to its owner's hand.";
private static final String rule1 = "When {this} enters the battlefield, if you control two or more Forests, you may gain 3 life.";
private static final String rule2 = "When {this} enters the battlefield, if you control two or more Islands, you may return target tapped creature to its owner's hand.";
public SelkieHedgeMage(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G/U}");

View file

@ -47,7 +47,7 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
*/
public class ShepherdOfRot extends CardImpl {
final String rule = "Each player loses 1 life for each Zombie on the battlefield";
static final String rule = "Each player loses 1 life for each Zombie on the battlefield";
static final private FilterPermanent filter = new FilterPermanent("Zombie");

View file

@ -47,7 +47,7 @@ import mage.cards.CardSetInfo;
*/
public class SpiralingDuelist extends CardImpl {
private final String effectText = "Metalcraft - Spiraling Duelist has double strike as long as you control three or more artifacts.";
private static final String effectText = "Metalcraft - Spiraling Duelist has double strike as long as you control three or more artifacts.";
public SpiralingDuelist(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}");

View file

@ -76,7 +76,7 @@ public class ThoughtHemorrhage extends CardImpl {
class ThoughtHemorrhageEffect extends OneShotEffect {
final String rule = "Target player reveals his or her hand. {this} deals 3 damage to that player for each card with that name revealed this way. Search that player's graveyard, hand, and library for all cards with that name and exile them. Then that player shuffles his or her library";
static final String rule = "Target player reveals his or her hand. {this} deals 3 damage to that player for each card with that name revealed this way. Search that player's graveyard, hand, and library for all cards with that name and exile them. Then that player shuffles his or her library";
public ThoughtHemorrhageEffect() {
super(Outcome.Exile);

View file

@ -49,7 +49,7 @@ import mage.counters.CounterType;
*/
public class Thunderblust extends CardImpl {
private final String rule = "{this} has trample as long as it has a -1/-1 counter on it";
private static final String rule = "{this} has trample as long as it has a -1/-1 counter on it";
public Thunderblust(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}{R}{R}");

View file

@ -60,7 +60,7 @@ public class TuskguardCaptain extends CardImpl {
filter.add(new CounterPredicate(CounterType.P1P1));
}
final String rule = "Each creature you control with a +1/+1 counter on it has trample";
static final String rule = "Each creature you control with a +1/+1 counter on it has trample";
public TuskguardCaptain(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}");

View file

@ -61,7 +61,7 @@ public class WayOfTheThief extends CardImpl {
static {
filter.add(new SubtypePredicate("Gate"));
}
private final String rule = "Enchanted creature can't be blocked as long as you control a Gate";
private static final String rule = "Enchanted creature can't be blocked as long as you control a Gate";
public WayOfTheThief(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{U}");

View file

@ -52,7 +52,7 @@ import mage.players.Player;
*/
public class WoodvineElemental extends CardImpl {
final private String rule = "<i>Parley &mdash; </i> Whenever {this} attacks, each player reveals the top card of his or her library. "
static final private String rule = "<i>Parley &mdash; </i> Whenever {this} attacks, each player reveals the top card of his or her library. "
+ "For each nonland card revealed this way, attacking creatures you control get +1/+1 until end of turn. Then each player draws a card.";
public WoodvineElemental(UUID ownerId, CardSetInfo setInfo) {

View file

@ -36,7 +36,7 @@ import java.util.Objects;
*/
public class EpicEffect extends OneShotEffect {
final String rule = "<br>Epic <i>(For the rest of the game, you can't cast spells. At the beginning of each of your upkeeps for the rest of the game, copy this spell except for its epic ability. If the spell has targets, you may choose new targets for the copy)";
static final String rule = "<br>Epic <i>(For the rest of the game, you can't cast spells. At the beginning of each of your upkeeps for the rest of the game, copy this spell except for its epic ability. If the spell has targets, you may choose new targets for the copy)";
public EpicEffect() {
super(Outcome.Benefit);

View file

@ -74,7 +74,7 @@ public abstract class DraftCube {
private static final Logger logger = Logger.getLogger(DraftCube.class);
private final String name;
private final int boosterSize = 15;
private static final int boosterSize = 15;
protected List<CardIdentity> cubeCards = new ArrayList<>();
protected List<CardIdentity> leftCubeCards = new ArrayList<>();