diff --git a/src/main/java/forge/card/mana/ManaCostShard.java b/src/main/java/forge/card/mana/ManaCostShard.java index b4d421b1459..df87ae38d7f 100644 --- a/src/main/java/forge/card/mana/ManaCostShard.java +++ b/src/main/java/forge/card/mana/ManaCostShard.java @@ -70,7 +70,7 @@ public class ManaCostShard { /** A bitmask to represent any mana symbol as an integer. */ public abstract static class Atom { public static final int COLORLESS = 1 << 0; - + /** The Constant WHITE. */ public static final int WHITE = 1 << 1; @@ -109,9 +109,9 @@ public class ManaCostShard { * I choose the latter, because memory for boxed objects will be taken from * heap, while unboxed values will lay on stack, which is faster */ - + public static final ManaCostShard COLORLESS = new ManaCostShard(Atom.COLORLESS, "1"); - + /** The Constant X. */ public static final ManaCostShard X = new ManaCostShard(Atom.IS_X, "X"); @@ -340,11 +340,11 @@ public class ManaCostShard { public boolean isSnow() { return (this.shard & Atom.IS_SNOW) != 0; } - + public boolean isMonoColor() { int colormask = this.shard & (Atom.WHITE | Atom.BLUE | Atom.BLACK | Atom.RED | Atom.GREEN); return BinaryUtil.bitCount(colormask) == 1; - + } /** diff --git a/src/main/java/forge/card/spellability/SpellAbility.java b/src/main/java/forge/card/spellability/SpellAbility.java index 7c2d632fe35..9c104330d50 100644 --- a/src/main/java/forge/card/spellability/SpellAbility.java +++ b/src/main/java/forge/card/spellability/SpellAbility.java @@ -250,8 +250,8 @@ public abstract class SpellAbility { public void setManaCost(final String cost) { this.manaCost = cost; - } - + } + /** *

* Getter for the field additionalManaCost. diff --git a/src/main/java/forge/card/staticability/StaticAbilityCostChange.java b/src/main/java/forge/card/staticability/StaticAbilityCostChange.java index 9895ebfbf32..12ba8f0bca8 100644 --- a/src/main/java/forge/card/staticability/StaticAbilityCostChange.java +++ b/src/main/java/forge/card/staticability/StaticAbilityCostChange.java @@ -66,7 +66,7 @@ public class StaticAbilityCostChange { //modify the cost here return originalCost; } - + /** * Applies applyReduceCostAbility ability. * diff --git a/src/main/java/forge/game/limited/BoosterDraftAI.java b/src/main/java/forge/game/limited/BoosterDraftAI.java index 9a7c5553b72..7e64afb309b 100644 --- a/src/main/java/forge/game/limited/BoosterDraftAI.java +++ b/src/main/java/forge/game/limited/BoosterDraftAI.java @@ -522,17 +522,22 @@ public class BoosterDraftAI { // count each mana symbol in the mana cost for (ManaCostShard shard : mc.getShards()) { byte mask = shard.getColorMask(); - - if ((mask & CardColor.WHITE) > 0 ) + + if ((mask & CardColor.WHITE) > 0) { clrCnts[0].setCount(clrCnts[0].getCount() + 1); - if ((mask & CardColor.BLUE) > 0 ) + } + if ((mask & CardColor.BLUE) > 0) { clrCnts[1].setCount(clrCnts[1].getCount() + 1); - if ((mask & CardColor.BLACK) > 0 ) + } + if ((mask & CardColor.BLACK) > 0) { clrCnts[2].setCount(clrCnts[2].getCount() + 1); - if ((mask & CardColor.RED) > 0 ) + } + if ((mask & CardColor.RED) > 0) { clrCnts[3].setCount(clrCnts[3].getCount() + 1); - if ((mask & CardColor.GREEN) > 0 ) + } + if ((mask & CardColor.GREEN) > 0) { clrCnts[4].setCount(clrCnts[4].getCount() + 1); + } } } diff --git a/src/main/java/forge/game/limited/SealedDeck.java b/src/main/java/forge/game/limited/SealedDeck.java index af435e5dfaf..88ba97282ce 100644 --- a/src/main/java/forge/game/limited/SealedDeck.java +++ b/src/main/java/forge/game/limited/SealedDeck.java @@ -360,17 +360,22 @@ public class SealedDeck { // count each mana symbol in the mana cost for (ManaCostShard shard : mc.getShards()) { byte mask = shard.getColorMask(); - - if ((mask & CardColor.WHITE) > 0 ) + + if ((mask & CardColor.WHITE) > 0) { clrCnts[0].setCount(clrCnts[0].getCount() + 1); - if ((mask & CardColor.BLUE) > 0 ) + } + if ((mask & CardColor.BLUE) > 0) { clrCnts[1].setCount(clrCnts[1].getCount() + 1); - if ((mask & CardColor.BLACK) > 0 ) + } + if ((mask & CardColor.BLACK) > 0) { clrCnts[2].setCount(clrCnts[2].getCount() + 1); - if ((mask & CardColor.RED) > 0 ) + } + if ((mask & CardColor.RED) > 0) { clrCnts[3].setCount(clrCnts[3].getCount() + 1); - if ((mask & CardColor.GREEN) > 0 ) + } + if ((mask & CardColor.GREEN) > 0) { clrCnts[4].setCount(clrCnts[4].getCount() + 1); + } } } diff --git a/src/main/java/forge/game/zone/DefaultPlayerZone.java b/src/main/java/forge/game/zone/DefaultPlayerZone.java index 0d61060ebe2..264dcf3624d 100644 --- a/src/main/java/forge/game/zone/DefaultPlayerZone.java +++ b/src/main/java/forge/game/zone/DefaultPlayerZone.java @@ -180,7 +180,7 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl public final boolean contains(final Card c) { return this.getCardList().contains(c); } - + /* * (non-Javadoc) * @@ -194,7 +194,6 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl } return index; } - /** * Removes the. diff --git a/src/main/java/forge/game/zone/IPlayerZone.java b/src/main/java/forge/game/zone/IPlayerZone.java index 9a213ba2f8e..6733d6c578e 100644 --- a/src/main/java/forge/game/zone/IPlayerZone.java +++ b/src/main/java/forge/game/zone/IPlayerZone.java @@ -156,7 +156,7 @@ interface IPlayerZone { * @return position */ Integer getPosition(Card c); - + /** * isEmpty returns true if given zone contains no cards. * diff --git a/src/main/java/forge/game/zone/MagicStack.java b/src/main/java/forge/game/zone/MagicStack.java index c08655a86e9..2e88f6d6920 100644 --- a/src/main/java/forge/game/zone/MagicStack.java +++ b/src/main/java/forge/game/zone/MagicStack.java @@ -1376,7 +1376,7 @@ public class MagicStack extends MyObservable { public final void clearSimultaneousStack() { this.simultaneousStackEntryList.clear(); } - + /** *

* addSimultaneousStackEntry. diff --git a/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java b/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java index d9583a5b967..f09925e9996 100644 --- a/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java +++ b/src/main/java/forge/gui/deckeditor/controllers/CEditorQuestCardShop.java @@ -148,7 +148,7 @@ public final class CEditorQuestCardShop extends ACEditorBase 0) || manaCost.isPureGeneric(); final List shards = manaCost.getShards(); @@ -234,7 +233,7 @@ public class CardFaceSymbols { */ public static int getWidth(final CardManaCost manaCost) { int width = manaCost.getShards().size(); - if ( manaCost.getGenericCost() > 0 || ( manaCost.getGenericCost() == 0 && width == 0 ) ); + if (manaCost.getGenericCost() > 0 || (manaCost.getGenericCost() == 0 && width == 0)); width++; /* diff --git a/src/main/java/forge/gui/toolbox/SaveOpenDialog.java b/src/main/java/forge/gui/toolbox/SaveOpenDialog.java index 800cbf33e6b..d70726f0637 100644 --- a/src/main/java/forge/gui/toolbox/SaveOpenDialog.java +++ b/src/main/java/forge/gui/toolbox/SaveOpenDialog.java @@ -32,20 +32,19 @@ import javax.swing.filechooser.FileNameExtensionFilter; */ @SuppressWarnings("serial") public class SaveOpenDialog extends JPanel { - + private JFileChooser fc; - - + /** * Enum to contain information for filetype filtering in the open/save dialog. * Add more entries to enum as needed. - * - * + * + * */ public enum Filetypes { LAYOUT ("Layout File", "xml"), DECK ("Deck File", "dck"); - + private final String TypeName; private final String TypeExtension; Filetypes(String Name, String Extension) { @@ -53,16 +52,15 @@ public class SaveOpenDialog extends JPanel { this.TypeExtension = Extension; } } - + /** * - * constructor for a save or open dialog + * constructor for a save or open dialog. */ public SaveOpenDialog() { fc = new JFileChooser(); } - - + /** * Shows the open dialog for files. If no file selected, returns null. Pass null * to Type to allow all files to be viewed/opened. @@ -73,14 +71,13 @@ public class SaveOpenDialog extends JPanel { */ public File OpenDialog(final File defFileName, final Filetypes type) { fc.setCurrentDirectory(defFileName); - - if (type!=null) { + + if (type != null) { fc.setAcceptAllFileFilterUsed(false); final FileFilter filter = new FileNameExtensionFilter(type.TypeName, type.TypeExtension); fc.addChoosableFileFilter(filter); } - - + int RetValue = fc.showOpenDialog(getParent()); if (RetValue == JFileChooser.APPROVE_OPTION) { final File RetFile = fc.getSelectedFile(); @@ -88,7 +85,7 @@ public class SaveOpenDialog extends JPanel { } return null; } - + /** * Shows the save dialog. * @@ -100,31 +97,30 @@ public class SaveOpenDialog extends JPanel { public File SaveDialog(final File defFileName, final Filetypes type) { File RetFile = defFileName; fc.setCurrentDirectory(defFileName); - + /* set the file filter if desired */ - if (type!=null) { + if (type != null) { fc.setAcceptAllFileFilterUsed(false); final FileFilter filter = new FileNameExtensionFilter(type.TypeName, type.TypeExtension); fc.addChoosableFileFilter(filter); } - + int RetValue = fc.showSaveDialog(getParent()); - + /* user picked save */ if (RetValue == JFileChooser.APPROVE_OPTION) { RetFile = fc.getSelectedFile(); - + /* Adds extension if it is known and not given */ - if (type!=null & !(RetFile.getAbsolutePath().endsWith(type.TypeExtension))) { - RetFile = new File(RetFile.getAbsolutePath()+"."+type.TypeExtension); + if (type != null & !(RetFile.getAbsolutePath().endsWith(type.TypeExtension))) { + RetFile = new File(RetFile.getAbsolutePath() + "." + type.TypeExtension); } - - + return RetFile; } - + /* user picked cancel */ return null; } - -} \ No newline at end of file + +} diff --git a/src/main/java/forge/util/MyObservable.java b/src/main/java/forge/util/MyObservable.java index 304f71cdf2d..e0b9b3e3757 100644 --- a/src/main/java/forge/util/MyObservable.java +++ b/src/main/java/forge/util/MyObservable.java @@ -41,8 +41,8 @@ public class MyObservable extends Observable { this.notifyObservers(); if (Singletons.getModel() == null) { return; } - PhaseHandler phases = Singletons.getModel().getGameState().getPhaseHandler(); - + PhaseHandler phases = Singletons.getModel().getGameState().getPhaseHandler(); + if ((phases != null) && phases.isNeedToNextPhase()) { if (phases.isNeedToNextPhaseInit()) { // this is used.