reference counterType and amount from closure
parent
cd11dca989
commit
55fbb02f5b
|
@ -10,24 +10,20 @@ public class MagicRemoveCounterEvent extends MagicEvent {
|
|||
public MagicRemoveCounterEvent(final MagicPermanent permanent,final MagicCounterType counterType,final int amount) {
|
||||
super(
|
||||
permanent,
|
||||
new Object[]{counterType,amount},
|
||||
EVENT_ACTION,
|
||||
genDescription(permanent,counterType,amount)
|
||||
);
|
||||
}
|
||||
|
||||
private static final MagicEventAction EVENT_ACTION=new MagicEventAction() {
|
||||
new MagicEventAction() {
|
||||
@Override
|
||||
public void executeEvent(final MagicGame game,final MagicEvent event,final Object[] data,final Object[] choices) {
|
||||
final int amount=(Integer)data[1];
|
||||
game.doAction(new MagicChangeCountersAction(
|
||||
event.getPermanent(),
|
||||
(MagicCounterType)data[0],
|
||||
counterType,
|
||||
-amount,
|
||||
true
|
||||
));
|
||||
}
|
||||
};
|
||||
},
|
||||
genDescription(permanent,counterType,amount)
|
||||
);
|
||||
}
|
||||
|
||||
private static String genDescription(final MagicPermanent permanent,final MagicCounterType counterType,final int amount) {
|
||||
final StringBuilder description=new StringBuilder("Remove ");
|
||||
|
|
Loading…
Reference in New Issue