move constants to the right == expression

master
melvin 2012-10-03 16:17:55 +08:00
parent ca4ae7af9b
commit 79b3661202
37 changed files with 42 additions and 42 deletions

View File

@ -326,7 +326,7 @@ public strictfp class MersenneTwisterFast implements Serializable, Cloneable
int i, j, k;
setSeed(19650218);
i=1; j=0;
k = (N>array.length ? N : array.length);
k = (array.length < N ? N : array.length);
for (; k!=0; k--)
{
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >>> 30)) * 1664525)) + array[j] + j; /* non linear */

View File

@ -18,7 +18,7 @@ public class Archon_of_Justice {
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play==triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
MagicTargetChoice.TARGET_PERMANENT,

View File

@ -14,7 +14,7 @@ public class Blistergrub {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
final MagicPlayer player = permanent.getController();
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
player,

View File

@ -16,7 +16,7 @@ public class Bogardan_Firefiend {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
MagicTargetChoice.TARGET_CREATURE,

View File

@ -18,7 +18,7 @@ public class Butcher_of_Malakir {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
final MagicPlayer controller = permanent.getController();
return (MagicLocationType.Play==triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
controller,

View File

@ -14,7 +14,7 @@ public class Chronozoa {
public static final MagicWhenPutIntoGraveyardTrigger T3 = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation &&
return (triggerData.fromLocation == MagicLocationType.Play &&
permanent.getCounters(MagicCounterType.Charge) == 0) ?
new MagicEvent(
permanent,

View File

@ -17,7 +17,7 @@ public class Deadly_Grub {
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation &&
return (triggerData.fromLocation == MagicLocationType.Play &&
permanent.getCounters(MagicCounterType.Charge) == 0) ?
new MagicEvent(
permanent,

View File

@ -13,7 +13,7 @@ public class Doomed_Traveler {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
this,

View File

@ -32,7 +32,7 @@ public class Driver_of_the_Dead {
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
new MagicMayChoice(targetChoice),

View File

@ -17,7 +17,7 @@ public class Elder_Cathar {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
MagicTargetChoice.TARGET_CREATURE_YOU_CONTROL,

View File

@ -15,7 +15,7 @@ public class Festering_Goblin {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
MagicTargetChoice.TARGET_CREATURE,

View File

@ -18,7 +18,7 @@ public class Goblin_Arsonist {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
new MagicMayChoice(

View File

@ -39,7 +39,7 @@ public class Goblin_Marshal {
public static final MagicWhenPutIntoGraveyardTrigger T3 = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
this,

View File

@ -13,7 +13,7 @@ public class Gods__Eye__Gate_to_the_Reikai {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
this,

View File

@ -15,7 +15,7 @@ public class Keiga__the_Tide_Star {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play==triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
MagicTargetChoice.TARGET_CREATURE,

View File

@ -34,7 +34,7 @@ public class Kodama_of_the_Center_Tree {
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
if (MagicLocationType.Play == triggerData.fromLocation) {
if (triggerData.fromLocation == MagicLocationType.Play) {
final MagicPlayer player = permanent.getController();
final int cmc = game.filterTargets(player,
MagicTargetFilter.TARGET_SPIRIT_YOU_CONTROL).size()+1;

View File

@ -17,7 +17,7 @@ public class Maalfeld_Twins {
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
this,

View File

@ -13,7 +13,7 @@ public class Mausoleum_Guard {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
this,

View File

@ -36,7 +36,7 @@ public class Mogg_War_Marshal {
public static final MagicWhenPutIntoGraveyardTrigger T3 = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
this,

View File

@ -21,7 +21,7 @@ public class Moldgraf_Monstrosity {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
this,

View File

@ -15,7 +15,7 @@ public class Mycoid_Shepherd {
public static final MagicWhenPutIntoGraveyardTrigger T1 = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
new MagicSimpleMayChoice(

View File

@ -17,7 +17,7 @@ public class Necropede {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
new MagicMayChoice(

View File

@ -17,7 +17,7 @@ public class Pitchburn_Devils {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
MagicTargetChoice.NEG_TARGET_CREATURE_OR_PLAYER,

View File

@ -18,7 +18,7 @@ public class Polluted_Dead {
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
MagicTargetChoice.TARGET_LAND,

View File

@ -13,7 +13,7 @@ public class Roc_Egg {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
this,

View File

@ -18,7 +18,7 @@ public class Rotcrown_Ghoul {
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
permanent.getController(),

View File

@ -16,7 +16,7 @@ public class Soulcage_Fiend {
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
permanent.getController(),

View File

@ -14,7 +14,7 @@ public class Sprouting_Thrinax {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play==triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
this,

View File

@ -13,7 +13,7 @@ public class Tuktuk_the_Explorer {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play==triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
this,

View File

@ -19,7 +19,7 @@ public class Undead_Executioner {
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
new MagicMayChoice(

View File

@ -17,7 +17,7 @@ public class Weatherseed_Treefolk {
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play == triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
this,

View File

@ -14,7 +14,7 @@ public class Wurmcoil_Engine {
public static final MagicWhenPutIntoGraveyardTrigger T = new MagicWhenPutIntoGraveyardTrigger() {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
return (MagicLocationType.Play==triggerData.fromLocation) ?
return (triggerData.fromLocation == MagicLocationType.Play) ?
new MagicEvent(
permanent,
this,

View File

@ -172,15 +172,15 @@ public class CardDefinitions {
}
public static MagicCardDefinition getBasicLand(final MagicColor color) {
if (MagicColor.Black == color) {
if (color == MagicColor.Black) {
return getCard("Swamp");
} else if (MagicColor.Blue == color) {
} else if (color == MagicColor.Blue) {
return getCard("Island");
} else if (MagicColor.Green == color) {
} else if (color == MagicColor.Green) {
return getCard("Forest");
} else if (MagicColor.Red == color) {
} else if (color == MagicColor.Red) {
return getCard("Mountain");
} else if (MagicColor.White == color) {
} else if (color == MagicColor.White) {
return getCard("Plains");
}
throw new RuntimeException("No matching basic land for MagicColor " + color);

View File

@ -117,10 +117,10 @@ public abstract class MagicChoice {
final MagicSource source);
public static boolean isYesChoice(final Object choiceResult) {
return YES_CHOICE==choiceResult;
return choiceResult == YES_CHOICE;
}
public static boolean isNoChoice(final Object choiceResult) {
return NO_CHOICE==choiceResult;
return choiceResult == NO_CHOICE;
}
}

View File

@ -22,7 +22,7 @@ public class MagicDieDrawCardTrigger extends MagicWhenPutIntoGraveyardTrigger {
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
if (MagicLocationType.Play == triggerData.fromLocation) {
if (triggerData.fromLocation == MagicLocationType.Play) {
return mustDraw ?
new MagicEvent(
permanent,

View File

@ -24,7 +24,7 @@ public class MagicModularTrigger extends MagicWhenPutIntoGraveyardTrigger {
@Override
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicGraveyardTriggerData triggerData) {
if (MagicLocationType.Play == triggerData.fromLocation) {
if (triggerData.fromLocation == MagicLocationType.Play) {
final int amount = permanent.getCounters(MagicCounterType.PlusOne);
return new MagicEvent(
permanent,

View File

@ -29,7 +29,7 @@ public class MagicSoulshiftTrigger extends MagicWhenPutIntoGraveyardTrigger {
final MagicGame game,
final MagicPermanent permanent,
final MagicGraveyardTriggerData triggerData) {
if (MagicLocationType.Play == triggerData.fromLocation) {
if (triggerData.fromLocation == MagicLocationType.Play) {
final MagicPlayer player = permanent.getController();
final MagicTargetFilter targetFilter =
new MagicTargetFilter.MagicCMCTargetFilter(