replaced null with MagicPermanent.NONE, replaced if with ?: operator

master
melvin 2011-09-04 15:43:30 +08:00
parent 463a01055f
commit fdf28d11a1
1 changed files with 9 additions and 10 deletions

View File

@ -22,15 +22,14 @@ public class Followed_Footsteps {
public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer data) { public MagicEvent executeTrigger(final MagicGame game,final MagicPermanent permanent,final MagicPlayer data) {
final MagicPlayer player=permanent.getController(); final MagicPlayer player=permanent.getController();
final MagicPermanent enchantedCreature=permanent.getEnchantedCreature(); final MagicPermanent enchantedCreature=permanent.getEnchantedCreature();
if (player==data && enchantedCreature!=null) { return (player==data && enchantedCreature!=MagicPermanent.NONE) ?
return new MagicEvent( new MagicEvent(
permanent, permanent,
player, player,
new Object[]{permanent,player}, new Object[]{permanent,player},
this, this,
player + " puts a token that's a copy of enchanted creature onto the battlefield."); player + " puts a token that's a copy of enchanted creature onto the battlefield."):
} null;
return null;
} }
@Override @Override
@ -41,7 +40,7 @@ public class Followed_Footsteps {
final Object[] choiceResults) { final Object[] choiceResults) {
final MagicPermanent permanent=(MagicPermanent)data[0]; final MagicPermanent permanent=(MagicPermanent)data[0];
final MagicPermanent enchantedCreature=permanent.getEnchantedCreature(); final MagicPermanent enchantedCreature=permanent.getEnchantedCreature();
if (enchantedCreature!=null) { if (enchantedCreature!=MagicPermanent.NONE) {
game.doAction(new MagicPlayTokenAction((MagicPlayer)data[1],enchantedCreature.getCardDefinition())); game.doAction(new MagicPlayTokenAction((MagicPlayer)data[1],enchantedCreature.getCardDefinition()));
} }
} }