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) {
|
public static CardColor fromMask(int mask) {
|
||||||
return new CardColor((byte)mask);
|
return new CardColor((byte) mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
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;
|
||||||
}
|
}
|
||||||
@@ -284,7 +288,7 @@ public final class CardColor implements Comparable<CardColor> {
|
|||||||
|
|
||||||
public CardColor inverse() {
|
public CardColor inverse() {
|
||||||
byte mask = this.myColor;
|
byte mask = this.myColor;
|
||||||
mask ^= ( WHITE | BLUE | BLACK | GREEN | RED );
|
mask ^= (WHITE | BLUE | BLACK | GREEN | RED);
|
||||||
return fromMask(mask);
|
return fromMask(mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -332,6 +336,6 @@ public final class CardColor implements Comparable<CardColor> {
|
|||||||
* @return true, if successful
|
* @return true, if successful
|
||||||
*/
|
*/
|
||||||
public boolean sharesColorWith(CardColor ccOther) {
|
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
|
* @return
|
||||||
*/
|
*/
|
||||||
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -228,10 +229,11 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -809,9 +809,9 @@ public final class CardRules {
|
|||||||
PredicatesOp.NOR, Presets.IS_LAND);
|
PredicatesOp.NOR, Presets.IS_LAND);
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@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,
|
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. */
|
/** The Constant isWhite. */
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ public final class AbilityFactoryCharm {
|
|||||||
timingRight = true;
|
timingRight = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((timingRight || i < num-1) && sub.doTrigger(false)) {
|
if ((timingRight || i < num - 1) && sub.doTrigger(false)) {
|
||||||
chosen = (AbilitySub) sub;
|
chosen = (AbilitySub) sub;
|
||||||
choices.remove(sub);
|
choices.remove(sub);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|||||||
@@ -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") {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user