replace parameter for single parameter closure with 'it'

master
melvin 2014-07-28 20:53:08 +08:00
parent 3e7884f212
commit 971c286657
7 changed files with 9 additions and 16 deletions

View File

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

View File

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

View File

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

View File

@ -14,11 +14,10 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent targetPermanent ->
game.doAction(new MagicChangeTurnPTAction(targetPermanent,-5,-5));
game.doAction(new MagicChangeTurnPTAction(it,-5,-5));
final MagicDamage damage = new MagicDamage(
event.getSource(),
targetPermanent.getController(),
it.getController(),
5
);
game.doAction(new MagicDealDamageAction(damage));

View File

@ -13,9 +13,8 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent targetPermanent ->
final MagicTargetFilter<MagicPermanent> targetFilter =
new MagicNameTargetFilter(targetPermanent.getName());
new MagicNameTargetFilter(it.getName());
final Collection<MagicPermanent> targets =
game.filterPermanents(event.getPlayer(),targetFilter);
for (final MagicPermanent target : targets) {

View File

@ -14,8 +14,7 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent targetPermanent ->
game.doAction(new MagicDestroyAction(targetPermanent));
game.doAction(new MagicDestroyAction(it));
final MagicPlayer you = event.getPlayer();
if (you.controlsPermanent(MagicSubType.Treefolk)){
game.doAction(new MagicDrawAction(you));

View File

@ -13,9 +13,8 @@
@Override
public void executeEvent(final MagicGame game, final MagicEvent event) {
event.processTargetPermanent(game, {
final MagicPermanent targetPermanent ->
game.doAction(MagicChangeStateAction.Set(targetPermanent,MagicPermanentState.CannotBeRegenerated));
game.doAction(new MagicDestroyAction(targetPermanent));
game.doAction(MagicChangeStateAction.Set(it,MagicPermanentState.CannotBeRegenerated));
game.doAction(new MagicDestroyAction(it));
game.doAction(new MagicDrawAction(event.getPlayer()));
});
}