Commit 0edca016 authored by Ghyselen's avatar Ghyselen
Browse files

Merge gitlab.crans.org:genie_logiciel_2015/the_dungeon_project

parents c07d211c a9e08639
......@@ -116,6 +116,7 @@ public final class MapBuilder implements Serializable{
int nbRooms=rooms.size();
Random r=new Random();
MapPatterns.read();
RoomBuilder.reset();
maxEntities=(int) (nbRooms*(3+r.nextGaussian()));
for (RoomBuilder room : rooms) {
room.getSurface().surroundWith(map, TileType.WALL);
......
......@@ -14,6 +14,13 @@ import core.zone.Point;
public class MapTests {
@Test
public void testThereIsEntities(){
for (int i = 0; i < 100; i++) {
Map map = MapGeneration.mapGeneration(20, 20);
assertTrue("Error only "+map.getEntities().length, map.getEntities().length > 3);
}
}
@Test
public void testHardEveryRoomAreReachable(){
Map map = MapGeneration.mapGeneration(20, 1000);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment