mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- CheckStyle.
This commit is contained in:
@@ -57,23 +57,28 @@ public final class CardColor implements Comparable<CardColor> {
|
||||
}
|
||||
|
||||
public static CardColor fromMask(int mask) {
|
||||
return new CardColor((byte)mask);
|
||||
return new CardColor((byte) mask);
|
||||
}
|
||||
|
||||
public static CardColor fromNames(String... colors) {
|
||||
byte mask = 0;
|
||||
for(String s : colors) {
|
||||
if ( s.equalsIgnoreCase(Constant.Color.WHITE) || s.equalsIgnoreCase("w"))
|
||||
for (String s : colors) {
|
||||
if (s.equalsIgnoreCase(Constant.Color.WHITE) || s.equalsIgnoreCase("w")) {
|
||||
mask |= WHITE;
|
||||
if ( s.equalsIgnoreCase(Constant.Color.BLUE) || s.equalsIgnoreCase("u"))
|
||||
}
|
||||
if (s.equalsIgnoreCase(Constant.Color.BLUE) || s.equalsIgnoreCase("u")) {
|
||||
mask |= BLUE;
|
||||
if ( s.equalsIgnoreCase(Constant.Color.BLACK) || s.equalsIgnoreCase("b"))
|
||||
}
|
||||
if (s.equalsIgnoreCase(Constant.Color.BLACK) || s.equalsIgnoreCase("b")) {
|
||||
mask |= BLACK;
|
||||
if ( s.equalsIgnoreCase(Constant.Color.RED) || s.equalsIgnoreCase("r"))
|
||||
}
|
||||
if (s.equalsIgnoreCase(Constant.Color.RED) || s.equalsIgnoreCase("r")) {
|
||||
mask |= RED;
|
||||
if ( s.equalsIgnoreCase(Constant.Color.GREEN) || s.equalsIgnoreCase("g"))
|
||||
}
|
||||
if (s.equalsIgnoreCase(Constant.Color.GREEN) || s.equalsIgnoreCase("g")) {
|
||||
mask |= GREEN;
|
||||
}
|
||||
}
|
||||
return fromMask(mask);
|
||||
}
|
||||
|
||||
@@ -107,13 +112,12 @@ public final class CardColor implements Comparable<CardColor> {
|
||||
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) {
|
||||
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) {
|
||||
return (~this.myColor & colorProfile) == 0;
|
||||
}
|
||||
@@ -284,7 +288,7 @@ public final class CardColor implements Comparable<CardColor> {
|
||||
|
||||
public CardColor inverse() {
|
||||
byte mask = this.myColor;
|
||||
mask ^= ( WHITE | BLUE | BLACK | GREEN | RED );
|
||||
mask ^= (WHITE | BLUE | BLACK | GREEN | RED);
|
||||
return fromMask(mask);
|
||||
}
|
||||
|
||||
@@ -332,6 +336,6 @@ public final class CardColor implements Comparable<CardColor> {
|
||||
* @return true, if successful
|
||||
*/
|
||||
public boolean sharesColorWith(CardColor ccOther) {
|
||||
return ( this.myColor & ccOther.myColor ) != 0;
|
||||
return (this.myColor & ccOther.myColor) != 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,10 +215,11 @@ public final class CardManaCost implements Comparable<CardManaCost> {
|
||||
* @return
|
||||
*/
|
||||
public boolean hasPhyrexian() {
|
||||
for(CardManaCostShard shard : shards) {
|
||||
if ( shard.isPhyrexian() )
|
||||
for (CardManaCostShard shard : shards) {
|
||||
if (shard.isPhyrexian()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -228,10 +229,11 @@ public final class CardManaCost implements Comparable<CardManaCost> {
|
||||
*/
|
||||
public int countX() {
|
||||
int iX = 0;
|
||||
for(CardManaCostShard shard : shards) {
|
||||
if ( shard == CardManaCostShard.X )
|
||||
for (CardManaCostShard shard : shards) {
|
||||
if (shard == CardManaCostShard.X) {
|
||||
iX++;
|
||||
}
|
||||
}
|
||||
return iX;
|
||||
}
|
||||
|
||||
|
||||
@@ -809,9 +809,9 @@ public final class CardRules {
|
||||
PredicatesOp.NOR, Presets.IS_LAND);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public static final Predicate<CardRules> isNonCreatureSpellForGenerator = Predicate.or( Arrays.asList(
|
||||
public static final Predicate<CardRules> isNonCreatureSpellForGenerator = Predicate.or(Arrays.asList(
|
||||
Presets.IS_SORCERY, Presets.IS_INSTANT, Presets.IS_PLANESWALKER, Presets.IS_ENCHANTMENT,
|
||||
Predicate.compose(Presets.IS_ARTIFACT, PredicatesOp.GT, Presets.IS_CREATURE ))
|
||||
Predicate.compose(Presets.IS_ARTIFACT, PredicatesOp.GT, Presets.IS_CREATURE))
|
||||
);
|
||||
|
||||
/** The Constant isWhite. */
|
||||
|
||||
@@ -165,7 +165,7 @@ public final class AbilityFactoryCharm {
|
||||
timingRight = true;
|
||||
break;
|
||||
}
|
||||
if ((timingRight || i < num-1) && sub.doTrigger(false)) {
|
||||
if ((timingRight || i < num - 1) && sub.doTrigger(false)) {
|
||||
chosen = (AbilitySub) sub;
|
||||
choices.remove(sub);
|
||||
break;
|
||||
|
||||
@@ -154,8 +154,8 @@ public abstract class AbstractCardFactory implements CardFactoryInterface {
|
||||
*/
|
||||
@Override
|
||||
public Iterator<Card> iterator() {
|
||||
if ( allCardsReadOnly == null )
|
||||
{
|
||||
if (allCardsReadOnly == null) {
|
||||
|
||||
allCardsReadOnly = Collections.unmodifiableList(getAllCards());
|
||||
}
|
||||
return allCardsReadOnly.iterator();
|
||||
|
||||
@@ -84,7 +84,6 @@ public class CardFactoryCreatures {
|
||||
card.addSpellAbility(spell);
|
||||
}
|
||||
|
||||
|
||||
private static void getCard_GilderBairn(final Card card, final String cardName) {
|
||||
final Cost abCost = new Cost(card, "2 GU Untap", true);
|
||||
final Target tgt = new Target(card, "Select target permanent.", new String[] { "Permanent" });
|
||||
@@ -299,7 +298,6 @@ public class CardFactoryCreatures {
|
||||
card.addComesIntoPlayCommand(intoPlay);
|
||||
}
|
||||
|
||||
|
||||
private static void getCard_SkySwallower(final Card card, final String cardName) {
|
||||
final SpellAbility ability = new Ability(card, "0") {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user