replace parameter for single parameter closure with 'it'

master
melvin 2014-07-28 20:58:05 +08:00
parent 971c286657
commit 92e0befff5
22 changed files with 29 additions and 51 deletions

View File

@ -15,8 +15,7 @@
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
event.processTargetCard(game, {
final MagicCard chosen ->
game.doAction(new MagicEnterAsCopyAction(event.getCardOnStack(), chosen))
game.doAction(new MagicEnterAsCopyAction(event.getCardOnStack(), it))
});
} else {
game.doAction(new MagicPlayCardFromStackAction(

View File

@ -26,9 +26,8 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetCard(game, {
final MagicCard target ->
game.doAction(new MagicReanimateAction(
target,
it,
event.getPlayer(),
[MagicPlayMod.BLACK, MagicPlayMod.NIGHTMARE]
));

View File

@ -15,8 +15,7 @@
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
event.processTargetPermanent(game, {
final MagicPermanent toSacrifice ->
game.doAction(new MagicSacrificeAction(toSacrifice));
game.doAction(new MagicSacrificeAction(it));
final MagicPermanent perm = event.getPermanent();
game.doAction(new MagicTapAction(perm, true)); //tap
game.doAction(new MagicChangeCountersAction(perm, MagicCounterType.PlusOne, 1, true));

View File

@ -20,8 +20,7 @@ def PT = new MagicStatic(MagicLayer.SetPT, MagicStatic.UntilEOT) {
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
MagicPermanent creature ->
game.doAction(new MagicBecomesCreatureAction(creature,PT));
game.doAction(new MagicBecomesCreatureAction(it,PT));
});
}
}

View File

@ -12,9 +12,8 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetCardOnStack(game, {
final MagicCardOnStack counteredCard ->
game.doAction(new MagicCounterItemOnStackAction(counteredCard));
game.addEvent(new MagicDiscardEvent(event.getSource(),counteredCard.getController()));
game.doAction(new MagicCounterItemOnStackAction(it));
game.addEvent(new MagicDiscardEvent(event.getSource(),it.getController()));
});
}
}

View File

@ -13,12 +13,11 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetCardOnStack(game, {
final MagicCardOnStack card ->
game.doAction(new MagicCounterItemOnStackAction(card));
game.doAction(new MagicCounterItemOnStackAction(it));
game.doAction(new MagicChangeCountersAction(
event.getPermanent(),
MagicCounterType.PlusOne,
card.getConvertedCost(),
it.getConvertedCost(),
true
));
});

View File

@ -13,8 +13,7 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
MagicPermanent permanent ->
game.doAction(new MagicTapAction(permanent, true));
game.doAction(new MagicTapAction(it, true));
game.doAction(new MagicAddTriggerAction(
MagicAtUpkeepTrigger.YouDraw(
event.getSource(),

View File

@ -14,8 +14,7 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTarget(game, {
MagicTarget target ->
final MagicDamage damage=new MagicDamage(event.getSource(),target,1);
final MagicDamage damage=new MagicDamage(event.getSource(),it,1);
game.doAction(new MagicDealDamageAction(damage));
game.doAction(new MagicAddTriggerAction(
MagicAtUpkeepTrigger.YouDraw(

View File

@ -14,8 +14,7 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTarget(game, {
MagicTarget target ->
game.doAction(new MagicPreventDamageAction(target,1));
game.doAction(new MagicPreventDamageAction(it,1));
game.doAction(new MagicAddTriggerAction(
MagicAtUpkeepTrigger.YouDraw(
event.getSource(),

View File

@ -14,10 +14,9 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent targetCreature ->
final MagicTargetFilter<MagicPermanent> targetFilter = new MagicNameTargetFilter(
MagicTargetFilterFactory.CREATURE,
targetCreature.getName()
it.getName()
);
final Collection<MagicPermanent> targets = game.filterPermanents(event.getPlayer(),targetFilter);
for (final MagicPermanent creature : targets) {

View File

@ -24,8 +24,7 @@ def TARGET_ARTIFACT_CREATURE_OR_LAND = new MagicTargetChoice(
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
MagicPermanent permanent ->
game.doAction(new MagicUntapAction(permanent));
game.doAction(new MagicUntapAction(it));
game.doAction(new MagicAddTriggerAction(
MagicAtUpkeepTrigger.YouDraw(
event.getSource(),

View File

@ -28,10 +28,9 @@ def INSTANT_LEQ_CMC_2_FROM_HAND = new MagicCardFilterImpl() {
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
event.processTargetCard(game, {
final MagicCard target ->
game.doAction(new MagicExileLinkAction(
event.getPermanent(),
target,
it,
MagicLocationType.OwnersHand
));
});

View File

@ -15,10 +15,9 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent artifact ->
game.doAction(new MagicGainControlAction(event.getPlayer(),artifact,MagicStatic.UntilEOT));
game.doAction(new MagicUntapAction(artifact));
game.doAction(new MagicGainAbilityAction(artifact,MagicAbility.Haste));
game.doAction(new MagicGainControlAction(event.getPlayer(),it,MagicStatic.UntilEOT));
game.doAction(new MagicUntapAction(it));
game.doAction(new MagicGainAbilityAction(it,MagicAbility.Haste));
});
}
}

View File

@ -19,9 +19,8 @@ def TP = new MagicStatic(MagicLayer.Type, MagicStatic.UntilEOT) {
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
MagicPermanent creature ->
game.doAction(new MagicBecomesCreatureAction(creature,TP));
game.doAction(new MagicChangeTurnPTAction(creature,3,-3));
game.doAction(new MagicBecomesCreatureAction(it,TP));
game.doAction(new MagicChangeTurnPTAction(it,3,-3));
});
}
}

View File

@ -24,11 +24,10 @@
@Override
public void executeEvent(final MagicGame outerGame, final MagicEvent outerEvent) {
outerEvent.processTargetPlayer(outerGame, {
final MagicPlayer outerPlayer ->
outerGame.addEvent(new MagicEvent(
outerEvent.getSource(),
MagicColorChoice.ALL_INSTANCE,
outerPlayer,
it,
{
final MagicGame game, final MagicEvent event ->
final MagicColor color = event.getChosenColor();

View File

@ -34,8 +34,7 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetCardOnStack(game, {
final MagicCardOnStack counteredCard ->
game.addEvent(perplexChoice(event.getSource(),counteredCard));
game.addEvent(perplexChoice(event.getSource(),it));
});
}
}

View File

@ -28,10 +28,9 @@ def INSTANT_FROM_HAND = new MagicCardFilterImpl() {
public void executeEvent(final MagicGame game, final MagicEvent event) {
if (event.isYes()) {
event.processTargetCard(game, {
final MagicCard target ->
game.doAction(new MagicExileLinkAction(
event.getPermanent(),
target,
it,
MagicLocationType.OwnersHand
));
});

View File

@ -1,8 +1,7 @@
def action = {
final MagicGame game, final MagicEvent event ->
event.processTargetItemOnStack(game, {
final MagicItemOnStack item ->
game.doAction(new MagicChangeTargetAction(item, event.getPermanent()));
game.doAction(new MagicChangeTargetAction(it, event.getPermanent()));
});
}

View File

@ -13,8 +13,7 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPlayer(game, {
MagicPlayer player ->
final MagicDamage damage=new MagicDamage(event.getSource(),player,1);
final MagicDamage damage=new MagicDamage(event.getSource(),it,1);
game.doAction(new MagicDealDamageAction(damage));
game.doAction(new MagicChangeLifeAction(event.getPlayer(),1));
game.doAction(new MagicAddTriggerAction(

View File

@ -12,9 +12,8 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetCardOnStack(game, {
final MagicCardOnStack counteredCard ->
game.doAction(new MagicCounterItemOnStackAction(counteredCard));
game.doAction(new MagicChangeLifeAction(counteredCard.getController(),-3));
game.doAction(new MagicCounterItemOnStackAction(it));
game.doAction(new MagicChangeLifeAction(it.getController(),-3));
});
}
}

View File

@ -13,10 +13,9 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetCardOnStack(game, {
final MagicCardOnStack cardOnStack ->
game.doAction(new MagicRemoveItemFromStackAction(cardOnStack));
game.doAction(new MagicRemoveItemFromStackAction(it));
game.doAction(new MagicMoveCardAction(
cardOnStack.getCard(),
it.getCard(),
MagicLocationType.Stack,
MagicLocationType.OwnersHand
));

View File

@ -26,9 +26,8 @@ def AB = new MagicStatic(MagicLayer.Ability, MagicStatic.UntilEOT) {
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
MagicPermanent creature ->
game.doAction(new MagicBecomesCreatureAction(
creature,
it,
PT,
MagicStatic.AllCreatureTypesUntilEOT,
AB