use ordinal instead of hashcode for phase and step, print name instead of hashcode for idstring

master
melvin 2011-06-16 21:09:48 +08:00
parent 0eb3b14dc7
commit 4bd2f7579f
1 changed files with 7 additions and 7 deletions

View File

@ -176,8 +176,8 @@ public class MagicGame {
public long getGameId() {
long[] input = {
turn,
phase.hashCode(),
step.hashCode(),
phase.getType().ordinal(),
step.ordinal(),
priorityPassedCount,
landPlayed,
players[0].getPlayerId(),
@ -189,8 +189,8 @@ public class MagicGame {
public String getIdString() {
return "\n" +
turn + " " +
phase.hashCode() + " " +
step.hashCode() + " " +
phase.getType() + " " +
step + " " +
priorityPassedCount + " " +
landPlayed + " " +
"\n" +
@ -202,7 +202,7 @@ public class MagicGame {
public long getGameId(final int pruneScore) {
long id=0;
id = id*ID_FACTOR + turn;
id = id*ID_FACTOR + phase.getType().getIndex();
id = id*ID_FACTOR + phase.getType().ordinal();
id = id*ID_FACTOR + score + pruneScore;
id = players[0].getPlayerId(id);
id = players[1].getPlayerId(id);
@ -375,11 +375,11 @@ public class MagicGame {
}
public long createIdentifier(final MagicIdentifierType type) {
return identifiers[type.getIndex()]++;
return identifiers[type.ordinal()]++;
}
public void releaseIdentifier(final MagicIdentifierType type) {
identifiers[type.getIndex()]--;
identifiers[type.ordinal()]--;
}
public void setIdentifiers(final long identifiers[]) {