event id is source id + action

master
melvin 2011-06-19 15:27:17 +08:00
parent b0b9a93626
commit 3956d8809b
1 changed files with 2 additions and 4 deletions

View File

@ -75,13 +75,11 @@ public class MagicEvent implements MagicCopyable {
@Override
public MagicCopyable create() {
return new MagicEvent();
}
@Override
public void copy(final MagicCopyMap copyMap,final MagicCopyable copySource) {
final MagicEvent sourceEvent=(MagicEvent)copySource;
source=(MagicSource)copyMap.copyObject(sourceEvent.source);
player=copyMap.copy(sourceEvent.player);
@ -194,7 +192,7 @@ public class MagicEvent implements MagicCopyable {
return "EVENT: " + player.getIndex() + " " + description + " " + (choice != null ? choice.getDescription() : "null");
}
public int getEventId() {
return toString().hashCode();
public long getEventId() {
return source.getId() + action.hashCode();
}
}