v0.6.0: switched to linked hash map to make rng deterministic
This commit is contained in:
parent
278c0d6b66
commit
af90cb7f73
|
@ -151,6 +151,7 @@ import com.watabou.utils.Random;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
public class Generator {
|
||||
|
||||
|
@ -201,7 +202,7 @@ public class Generator {
|
|||
{0, 2, 8, 20, 70}
|
||||
};
|
||||
|
||||
private static HashMap<Category,Float> categoryProbs = new HashMap<Generator.Category, Float>();
|
||||
private static HashMap<Category,Float> categoryProbs = new LinkedHashMap<>();
|
||||
|
||||
private static final float[] INITIAL_ARTIFACT_PROBS = new float[]{ 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1};
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
|||
import com.watabou.utils.Random;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
public abstract class ConnectionRoom extends Room {
|
||||
|
||||
|
@ -49,7 +50,7 @@ public abstract class ConnectionRoom extends Room {
|
|||
else return 4;
|
||||
}
|
||||
|
||||
private static HashMap<Class<?extends ConnectionRoom>, Float> chances = new HashMap<>();
|
||||
private static HashMap<Class<?extends ConnectionRoom>, Float> chances = new LinkedHashMap<>();
|
||||
|
||||
static {
|
||||
chances.put(TunnelRoom.class, 10f);
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.Room;
|
|||
import com.watabou.utils.Random;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
public abstract class StandardRoom extends Room {
|
||||
|
||||
|
@ -72,12 +73,12 @@ public abstract class StandardRoom extends Room {
|
|||
else return 4;
|
||||
}
|
||||
|
||||
private static HashMap<Class<?extends StandardRoom>, Float> chances = new HashMap<>();
|
||||
private static HashMap<Class<?extends StandardRoom>, Float> chances = new LinkedHashMap<>();
|
||||
|
||||
static {
|
||||
chances.put(EmptyRoom.class, 24f);
|
||||
|
||||
chances.put(PlatformRoom.class, 1f);
|
||||
chances.put(PlatformRoom.class, 1f);
|
||||
chances.put(BurnedRoom.class, 1f);
|
||||
chances.put(FissureRoom.class, 1f);
|
||||
chances.put(GrassyGraveRoom.class, 1f);
|
||||
|
|
Loading…
Reference in New Issue
Block a user