- CheckStyle.

This commit is contained in:
Chris
2012-04-08 12:33:59 +00:00
parent 351b5584a8
commit 6bf3d613f1
8 changed files with 77 additions and 73 deletions

View File

@@ -63,17 +63,22 @@ public final class CardColor implements Comparable<CardColor> {
public static CardColor fromNames(String... colors) { public static CardColor fromNames(String... colors) {
byte mask = 0; byte mask = 0;
for (String s : colors) { for (String s : colors) {
if ( s.equalsIgnoreCase(Constant.Color.WHITE) || s.equalsIgnoreCase("w")) if (s.equalsIgnoreCase(Constant.Color.WHITE) || s.equalsIgnoreCase("w")) {
mask |= WHITE; mask |= WHITE;
if ( s.equalsIgnoreCase(Constant.Color.BLUE) || s.equalsIgnoreCase("u")) }
if (s.equalsIgnoreCase(Constant.Color.BLUE) || s.equalsIgnoreCase("u")) {
mask |= BLUE; mask |= BLUE;
if ( s.equalsIgnoreCase(Constant.Color.BLACK) || s.equalsIgnoreCase("b")) }
if (s.equalsIgnoreCase(Constant.Color.BLACK) || s.equalsIgnoreCase("b")) {
mask |= BLACK; mask |= BLACK;
if ( s.equalsIgnoreCase(Constant.Color.RED) || s.equalsIgnoreCase("r")) }
if (s.equalsIgnoreCase(Constant.Color.RED) || s.equalsIgnoreCase("r")) {
mask |= RED; mask |= RED;
if ( s.equalsIgnoreCase(Constant.Color.GREEN) || s.equalsIgnoreCase("g")) }
if (s.equalsIgnoreCase(Constant.Color.GREEN) || s.equalsIgnoreCase("g")) {
mask |= GREEN; mask |= GREEN;
} }
}
return fromMask(mask); return fromMask(mask);
} }
@@ -107,13 +112,12 @@ public final class CardColor implements Comparable<CardColor> {
return (this.myColor & colormask) == colormask; return (this.myColor & colormask) == colormask;
} }
/** this has no other colors except defined by operand */ /** this has no other colors except defined by operand. */
public boolean hasNoColorsExcept(final int colormask) { public boolean hasNoColorsExcept(final int colormask) {
return (this.myColor & ~colormask) == 0; return (this.myColor & ~colormask) == 0;
} }
/** Operand has no other colors except defined by this. */
/** Operand has no other colors except defined by this */
public boolean containsAllColorsFrom(int colorProfile) { public boolean containsAllColorsFrom(int colorProfile) {
return (~this.myColor & colorProfile) == 0; return (~this.myColor & colorProfile) == 0;
} }

View File

@@ -216,9 +216,10 @@ public final class CardManaCost implements Comparable<CardManaCost> {
*/ */
public boolean hasPhyrexian() { public boolean hasPhyrexian() {
for (CardManaCostShard shard : shards) { for (CardManaCostShard shard : shards) {
if ( shard.isPhyrexian() ) if (shard.isPhyrexian()) {
return true; return true;
} }
}
return false; return false;
} }
@@ -229,9 +230,10 @@ public final class CardManaCost implements Comparable<CardManaCost> {
public int countX() { public int countX() {
int iX = 0; int iX = 0;
for (CardManaCostShard shard : shards) { for (CardManaCostShard shard : shards) {
if ( shard == CardManaCostShard.X ) if (shard == CardManaCostShard.X) {
iX++; iX++;
} }
}
return iX; return iX;
} }

View File

@@ -154,8 +154,8 @@ public abstract class AbstractCardFactory implements CardFactoryInterface {
*/ */
@Override @Override
public Iterator<Card> iterator() { public Iterator<Card> iterator() {
if ( allCardsReadOnly == null ) if (allCardsReadOnly == null) {
{
allCardsReadOnly = Collections.unmodifiableList(getAllCards()); allCardsReadOnly = Collections.unmodifiableList(getAllCards());
} }
return allCardsReadOnly.iterator(); return allCardsReadOnly.iterator();

View File

@@ -84,7 +84,6 @@ public class CardFactoryCreatures {
card.addSpellAbility(spell); card.addSpellAbility(spell);
} }
private static void getCard_GilderBairn(final Card card, final String cardName) { private static void getCard_GilderBairn(final Card card, final String cardName) {
final Cost abCost = new Cost(card, "2 GU Untap", true); final Cost abCost = new Cost(card, "2 GU Untap", true);
final Target tgt = new Target(card, "Select target permanent.", new String[] { "Permanent" }); final Target tgt = new Target(card, "Select target permanent.", new String[] { "Permanent" });
@@ -299,7 +298,6 @@ public class CardFactoryCreatures {
card.addComesIntoPlayCommand(intoPlay); card.addComesIntoPlayCommand(intoPlay);
} }
private static void getCard_SkySwallower(final Card card, final String cardName) { private static void getCard_SkySwallower(final Card card, final String cardName) {
final SpellAbility ability = new Ability(card, "0") { final SpellAbility ability = new Ability(card, "0") {