convert from java code to groovy code

master
melvin 2013-03-13 21:22:03 +08:00
parent e8d20c6133
commit ee1ac48247
3 changed files with 20 additions and 28 deletions

View File

@ -0,0 +1,19 @@
[
new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Draw four cards."
);
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] choiceResults) {
game.doAction(new MagicDrawAction(event.getPlayer(),4));
}
}
]

View File

@ -6,4 +6,4 @@ rarity=U
type=Sorcery
cost={3}{U}{U}
timing=draw
requires_card_code
requires_groovy_code

View File

@ -1,27 +0,0 @@
package magic.card;
import magic.model.MagicGame;
import magic.model.MagicPayedCost;
import magic.model.action.MagicDrawAction;
import magic.model.event.MagicEvent;
import magic.model.event.MagicSpellCardEvent;
import magic.model.stack.MagicCardOnStack;
public class Tidings {
public static final MagicSpellCardEvent S = new MagicSpellCardEvent() {
@Override
public MagicEvent getEvent(final MagicCardOnStack cardOnStack,final MagicPayedCost payedCost) {
return new MagicEvent(
cardOnStack,
this,
"Draw four cards.");
}
@Override
public void executeEvent(
final MagicGame game,
final MagicEvent event,
final Object[] choiceResults) {
game.doAction(new MagicDrawAction(event.getPlayer(),4));
}
};
}