- CheckStyle.

This commit is contained in:
Chris
2012-06-05 21:50:59 +00:00
parent e32ba2ee11
commit afa99e7bde
12 changed files with 61 additions and 57 deletions

View File

@@ -523,18 +523,23 @@ public class BoosterDraftAI {
for (ManaCostShard shard : mc.getShards()) { for (ManaCostShard shard : mc.getShards()) {
byte mask = shard.getColorMask(); byte mask = shard.getColorMask();
if ((mask & CardColor.WHITE) > 0 ) if ((mask & CardColor.WHITE) > 0) {
clrCnts[0].setCount(clrCnts[0].getCount() + 1); clrCnts[0].setCount(clrCnts[0].getCount() + 1);
if ((mask & CardColor.BLUE) > 0 ) }
if ((mask & CardColor.BLUE) > 0) {
clrCnts[1].setCount(clrCnts[1].getCount() + 1); clrCnts[1].setCount(clrCnts[1].getCount() + 1);
if ((mask & CardColor.BLACK) > 0 ) }
if ((mask & CardColor.BLACK) > 0) {
clrCnts[2].setCount(clrCnts[2].getCount() + 1); clrCnts[2].setCount(clrCnts[2].getCount() + 1);
if ((mask & CardColor.RED) > 0 ) }
if ((mask & CardColor.RED) > 0) {
clrCnts[3].setCount(clrCnts[3].getCount() + 1); clrCnts[3].setCount(clrCnts[3].getCount() + 1);
if ((mask & CardColor.GREEN) > 0 ) }
if ((mask & CardColor.GREEN) > 0) {
clrCnts[4].setCount(clrCnts[4].getCount() + 1); clrCnts[4].setCount(clrCnts[4].getCount() + 1);
} }
} }
}
if (landsNeeded > 0) { if (landsNeeded > 0) {
// total of all ClrCnts // total of all ClrCnts

View File

@@ -361,18 +361,23 @@ public class SealedDeck {
for (ManaCostShard shard : mc.getShards()) { for (ManaCostShard shard : mc.getShards()) {
byte mask = shard.getColorMask(); byte mask = shard.getColorMask();
if ((mask & CardColor.WHITE) > 0 ) if ((mask & CardColor.WHITE) > 0) {
clrCnts[0].setCount(clrCnts[0].getCount() + 1); clrCnts[0].setCount(clrCnts[0].getCount() + 1);
if ((mask & CardColor.BLUE) > 0 ) }
if ((mask & CardColor.BLUE) > 0) {
clrCnts[1].setCount(clrCnts[1].getCount() + 1); clrCnts[1].setCount(clrCnts[1].getCount() + 1);
if ((mask & CardColor.BLACK) > 0 ) }
if ((mask & CardColor.BLACK) > 0) {
clrCnts[2].setCount(clrCnts[2].getCount() + 1); clrCnts[2].setCount(clrCnts[2].getCount() + 1);
if ((mask & CardColor.RED) > 0 ) }
if ((mask & CardColor.RED) > 0) {
clrCnts[3].setCount(clrCnts[3].getCount() + 1); clrCnts[3].setCount(clrCnts[3].getCount() + 1);
if ((mask & CardColor.GREEN) > 0 ) }
if ((mask & CardColor.GREEN) > 0) {
clrCnts[4].setCount(clrCnts[4].getCount() + 1); clrCnts[4].setCount(clrCnts[4].getCount() + 1);
} }
} }
}
// total of all ClrCnts // total of all ClrCnts
int totalColor = 0; int totalColor = 0;

View File

@@ -195,7 +195,6 @@ public class DefaultPlayerZone extends PlayerZone implements java.io.Serializabl
return index; return index;
} }
/** /**
* Removes the. * Removes the.
* *

View File

@@ -138,7 +138,6 @@ public class CardFaceSymbols {
return; return;
} }
final int genericManaCost = manaCost.getGenericCost(); final int genericManaCost = manaCost.getGenericCost();
final boolean hasGeneric = (genericManaCost > 0) || manaCost.isPureGeneric(); final boolean hasGeneric = (genericManaCost > 0) || manaCost.isPureGeneric();
final List<ManaCostShard> shards = manaCost.getShards(); final List<ManaCostShard> shards = manaCost.getShards();
@@ -234,7 +233,7 @@ public class CardFaceSymbols {
*/ */
public static int getWidth(final CardManaCost manaCost) { public static int getWidth(final CardManaCost manaCost) {
int width = manaCost.getShards().size(); int width = manaCost.getShards().size();
if ( manaCost.getGenericCost() > 0 || ( manaCost.getGenericCost() == 0 && width == 0 ) ); if (manaCost.getGenericCost() > 0 || (manaCost.getGenericCost() == 0 && width == 0));
width++; width++;
/* /*

View File

@@ -35,7 +35,6 @@ public class SaveOpenDialog extends JPanel {
private JFileChooser fc; private JFileChooser fc;
/** /**
* Enum to contain information for filetype filtering in the open/save dialog. * Enum to contain information for filetype filtering in the open/save dialog.
* Add more entries to enum as needed. * Add more entries to enum as needed.
@@ -56,13 +55,12 @@ public class SaveOpenDialog extends JPanel {
/** /**
* *
* constructor for a save or open dialog * constructor for a save or open dialog.
*/ */
public SaveOpenDialog() { public SaveOpenDialog() {
fc = new JFileChooser(); fc = new JFileChooser();
} }
/** /**
* Shows the open dialog for files. If no file selected, returns null. Pass null * Shows the open dialog for files. If no file selected, returns null. Pass null
* to Type to allow all files to be viewed/opened. * to Type to allow all files to be viewed/opened.
@@ -74,13 +72,12 @@ public class SaveOpenDialog extends JPanel {
public File OpenDialog(final File defFileName, final Filetypes type) { public File OpenDialog(final File defFileName, final Filetypes type) {
fc.setCurrentDirectory(defFileName); fc.setCurrentDirectory(defFileName);
if (type!=null) { if (type != null) {
fc.setAcceptAllFileFilterUsed(false); fc.setAcceptAllFileFilterUsed(false);
final FileFilter filter = new FileNameExtensionFilter(type.TypeName, type.TypeExtension); final FileFilter filter = new FileNameExtensionFilter(type.TypeName, type.TypeExtension);
fc.addChoosableFileFilter(filter); fc.addChoosableFileFilter(filter);
} }
int RetValue = fc.showOpenDialog(getParent()); int RetValue = fc.showOpenDialog(getParent());
if (RetValue == JFileChooser.APPROVE_OPTION) { if (RetValue == JFileChooser.APPROVE_OPTION) {
final File RetFile = fc.getSelectedFile(); final File RetFile = fc.getSelectedFile();
@@ -102,7 +99,7 @@ public class SaveOpenDialog extends JPanel {
fc.setCurrentDirectory(defFileName); fc.setCurrentDirectory(defFileName);
/* set the file filter if desired */ /* set the file filter if desired */
if (type!=null) { if (type != null) {
fc.setAcceptAllFileFilterUsed(false); fc.setAcceptAllFileFilterUsed(false);
final FileFilter filter = new FileNameExtensionFilter(type.TypeName, type.TypeExtension); final FileFilter filter = new FileNameExtensionFilter(type.TypeName, type.TypeExtension);
fc.addChoosableFileFilter(filter); fc.addChoosableFileFilter(filter);
@@ -115,11 +112,10 @@ public class SaveOpenDialog extends JPanel {
RetFile = fc.getSelectedFile(); RetFile = fc.getSelectedFile();
/* Adds extension if it is known and not given */ /* Adds extension if it is known and not given */
if (type!=null & !(RetFile.getAbsolutePath().endsWith(type.TypeExtension))) { if (type != null & !(RetFile.getAbsolutePath().endsWith(type.TypeExtension))) {
RetFile = new File(RetFile.getAbsolutePath()+"."+type.TypeExtension); RetFile = new File(RetFile.getAbsolutePath() + "." + type.TypeExtension);
} }
return RetFile; return RetFile;
} }