- CheckStyle.

This commit is contained in:
Chris
2012-11-22 14:34:10 +00:00
parent 60e0f2bd7f
commit 946da55f9a
21 changed files with 100 additions and 86 deletions

View File

@@ -362,9 +362,13 @@ public class ManaCostShard {
*/
public boolean canBePaidWithManaOfColor(CardColor color) {
// can pay with life?
if ( (this.shard & Atom.OR_2_LIFE) != 0 ) return true;
if ((this.shard & Atom.OR_2_LIFE) != 0) {
return true;
}
// can pay with any color?
if ( (this.shard & Atom.OR_2_COLORLESS) != 0 || 0 != ( this.shard & Atom.COLORLESS ) ) return true;
if ((this.shard & Atom.OR_2_COLORLESS) != 0 || 0 != (this.shard & Atom.COLORLESS)) {
return true;
}
// either colored part is empty, or there are same colors in shard and mana source
return (0xFF & this.shard) == 0 || (color.getColor() & this.shard) > 0;
}

View File

@@ -179,8 +179,8 @@ public class ManaPool {
public final int clearPool(boolean isEndOfPhase) {
int numRemoved = 0;
if (isEndOfPhase &&
Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.manapoolsDontEmpty)) {
if (isEndOfPhase
&& Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.manapoolsDontEmpty)) {
return numRemoved;
}

View File

@@ -45,7 +45,7 @@ public class AbilityManaPart implements java.io.Serializable {
private String origProduced;
private String lastExpressChoice = "";
private String manaRestrictions = "";
transient private ArrayList<Mana> lastProduced = new ArrayList<Mana>();
private transient ArrayList<Mana> lastProduced = new ArrayList<Mana>();
private int amount = 1;
/** The reflected. */
@@ -54,9 +54,9 @@ public class AbilityManaPart implements java.io.Serializable {
/** The canceled. */
private boolean canceled = false;
transient private final Card sourceCard;
private final transient Card sourceCard;
transient private Cost cost;
private transient Cost cost;
// Spells paid with this mana spell can't be countered.
private boolean cannotCounterSpell;

View File

@@ -1,7 +1,7 @@
package forge.card.spellability;
/**
* Will collect here essential methods needed to hold ability on stack and resolve
* Will collect here essential methods needed to hold ability on stack and resolve.
*
*/
public interface ISpellAbility {

View File

@@ -520,9 +520,10 @@ public abstract class SpellAbility implements ISpellAbility {
* @param mapParams
*/
public void copyParamsToMap(Map<String, String> mapParams) {
if ( null != params )
if (null != params) {
mapParams.putAll(params);
}
}
// If this is not null, then ability was made in a factory
public ApiType getApi() {
@@ -1702,10 +1703,12 @@ public abstract class SpellAbility implements ISpellAbility {
public SpellAbility getParentTargetingCard() {
SpellAbility parent = this;
while( parent.getParent() != null)
{
while (parent.getParent() != null) {
Target tgt = parent.getTarget();
if ( tgt != null && tgt.getTargetCards() != null && !tgt.getTargetCards().isEmpty() ) break;
if (tgt != null && tgt.getTargetCards() != null && !tgt.getTargetCards().isEmpty()) {
break;
}
parent = parent.getParent();
}
return parent;
@@ -1720,10 +1723,12 @@ public abstract class SpellAbility implements ISpellAbility {
*/
public SpellAbility getParentTargetingSA() {
SpellAbility parent = this;
while( parent.getParent() != null)
{
while (parent.getParent() != null) {
Target tgt = parent.getTarget();
if ( tgt != null && tgt.getTargetSAs() != null && !tgt.getTargetSAs().isEmpty() ) break;
if (tgt != null && tgt.getTargetSAs() != null && !tgt.getTargetSAs().isEmpty()) {
break;
}
parent = parent.getParent();
}
return parent;
@@ -1738,10 +1743,12 @@ public abstract class SpellAbility implements ISpellAbility {
*/
public SpellAbility getParentTargetingPlayer() {
SpellAbility parent = this;
while( parent.getParent() != null)
{
while (parent.getParent() != null) {
Target tgt = parent.getTarget();
if ( tgt != null && tgt.getTargetPlayers() != null && !tgt.getTargetPlayers().isEmpty() ) break;
if (tgt != null && tgt.getTargetPlayers() != null && !tgt.getTargetPlayers().isEmpty()) {
break;
}
parent = parent.getParent();
}
return parent;
@@ -1759,9 +1766,10 @@ public abstract class SpellAbility implements ISpellAbility {
* TODO: Write javadoc for this method.
*/
public void undo() {
if ( isUndoable() )
if (isUndoable()) {
this.payCosts.refundPaidCost(sourceCard);
}
}
/**
* TODO: Write javadoc for this method.

View File

@@ -249,8 +249,8 @@ public class SpellPermanent extends Spell {
sourceCard.addLeavesPlayCommand(this.championCommandLeavesPlay);
}
if(this.getManaCost().contains("X"))
{
if (this.getManaCost().contains("X")) {
if (!this.getSourceCard().getSVar("X").equals("")) {
this.setSVar("X", this.getSourceCard().getSVar("X"));
}
@@ -349,8 +349,8 @@ public class SpellPermanent extends Spell {
}
// check on legendary
if (card.isType("Legendary") &&
!Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule)) {
if (card.isType("Legendary")
&& !Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule)) {
final List<Card> list = ai.getCardsIn(ZoneType.Battlefield);
if (Iterables.any(list, CardPredicates.nameEquals(card.getName()))) {
return false;

View File

@@ -718,7 +718,9 @@ public class Target {
boolean canTarget = (!isTargeted || c.canBeTargetedBy(sa));
boolean isAlreadyTargeted = this.getTargetCards().contains(c);
//System.out.print(c);
if ( isValidTarget && canTarget && !isAlreadyTargeted ) return true;
if (isValidTarget && canTarget && !isAlreadyTargeted) {
return true;
}
}
}