aboutsummaryrefslogtreecommitdiff
path: root/src/ch
diff options
context:
space:
mode:
Diffstat (limited to 'src/ch')
-rw-r--r--src/ch/epfl/xblast/server/Block.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ch/epfl/xblast/server/Block.java b/src/ch/epfl/xblast/server/Block.java
index 4f3d033..5cb662c 100644
--- a/src/ch/epfl/xblast/server/Block.java
+++ b/src/ch/epfl/xblast/server/Block.java
@@ -55,7 +55,19 @@ public enum Block {
55 /** 55 /**
56 * Pseudo-random source for randomized behaviours. 56 * Pseudo-random source for randomized behaviours.
57 */ 57 */
58 private static final Random RANDOM_SOURCE = new Random(RANDOM_SEED); 58 private static Random RANDOM_SOURCE;
59
60 /**
61 * Resets the random source used for bonus block spawning.
62 * Useful for deterministic tests.
63 */
64 public static void resetRandomGenerator() {
65 RANDOM_SOURCE = new Random(RANDOM_SEED);
66 }
67
68 static {
69 resetRandomGenerator();
70 }
59 71
60 /** 72 /**
61 * Corresponding bonus, or null. 73 * Corresponding bonus, or null.