Now generating primitive islands.
Favourable island mapper values.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package ca.recrown.islandsurvivalcraft.world;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
@@ -29,11 +30,11 @@ public class IslandWorldMapperTest {
|
||||
answers[x][y] = mapper.getWorldValue(x, y);
|
||||
}
|
||||
}
|
||||
blockValCache.clearCache();
|
||||
}
|
||||
|
||||
|
||||
@AfterEach
|
||||
public void individualCleanup() {
|
||||
random.setSeed(SEED);
|
||||
blockValCache.clearCache();
|
||||
}
|
||||
|
||||
@@ -60,4 +61,15 @@ public class IslandWorldMapperTest {
|
||||
assertEquals(answers[x][y], mapper.getWorldValue(x, y), String.format("Occurred at (%d, %d)", x, y));
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test2048ValuesValidity() {
|
||||
for (int i = 0; i < 1024; i++) {
|
||||
int x = random.nextInt();
|
||||
int y = random.nextInt();
|
||||
assertTrue((mapper.getWorldValue(x, y) <= 1));
|
||||
assertTrue((mapper.getWorldValue(x, y) >= -1));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user