changed MagicCard to use abs(hashCode) has imageIndex instead of using nextInt as nextInt is not synchronized
parent
1790228260
commit
52cf57c32e
|
@ -18,10 +18,10 @@ public class MagicCard implements MagicSource,MagicTarget,Comparable<MagicCard>
|
|||
private int imageIndex=0;
|
||||
|
||||
public MagicCard(final MagicCardDefinition cardDefinition,final MagicPlayer owner,final long id) {
|
||||
this.cardDefinition=cardDefinition;
|
||||
this.owner=owner;
|
||||
this.id=id;
|
||||
imageIndex=MagicRandom.nextInt(100);
|
||||
this.cardDefinition = cardDefinition;
|
||||
this.owner = owner;
|
||||
this.id = id;
|
||||
imageIndex = Math.abs(hashCode());
|
||||
}
|
||||
|
||||
private MagicCard() {}
|
||||
|
|
|
@ -88,6 +88,7 @@ public class MagicGame {
|
|||
private long[] keys;
|
||||
private long time = 1000000;
|
||||
|
||||
|
||||
public static MagicGame getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue