added getId

master
melvin 2011-07-01 11:33:00 +08:00
parent a7b96f922a
commit 887e8d511e
1 changed files with 6 additions and 5 deletions

View File

@ -10,23 +10,24 @@ public class MagicSourceManaActivationResult implements MagicMappable {
public final MagicManaActivation activation;
public MagicSourceManaActivationResult(final MagicPermanent permanent,final MagicManaActivation activation) {
this.permanent=permanent;
this.activation=activation;
}
@Override
public Object map(final MagicGame game) {
return new MagicSourceManaActivationResult((MagicPermanent)permanent.map(game),activation);
}
public void doActivation(final MagicGame game) {
for (final MagicEvent costEvent : activation.getCostEvent(permanent)) {
// Mana activation cost events do not have choices.
game.executeEvent(costEvent,MagicEvent.NO_CHOICE_RESULTS);
}
}
@Override
public long getId() {
return permanent.getId() * 31 + activation.hashCode();
}
}