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 final MagicManaActivation activation;
public MagicSourceManaActivationResult(final MagicPermanent permanent,final MagicManaActivation activation) { public MagicSourceManaActivationResult(final MagicPermanent permanent,final MagicManaActivation activation) {
this.permanent=permanent; this.permanent=permanent;
this.activation=activation; this.activation=activation;
} }
@Override @Override
public Object map(final MagicGame game) { public Object map(final MagicGame game) {
return new MagicSourceManaActivationResult((MagicPermanent)permanent.map(game),activation); return new MagicSourceManaActivationResult((MagicPermanent)permanent.map(game),activation);
} }
public void doActivation(final MagicGame game) { public void doActivation(final MagicGame game) {
for (final MagicEvent costEvent : activation.getCostEvent(permanent)) { for (final MagicEvent costEvent : activation.getCostEvent(permanent)) {
// Mana activation cost events do not have choices. // Mana activation cost events do not have choices.
game.executeEvent(costEvent,MagicEvent.NO_CHOICE_RESULTS); game.executeEvent(costEvent,MagicEvent.NO_CHOICE_RESULTS);
} }
} }
@Override
public long getId() {
return permanent.getId() * 31 + activation.hashCode();
}
} }