aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/fr/umlv/java/wallj/board/BoardValidator.java3
-rw-r--r--src/main/java/fr/umlv/java/wallj/model/BlockType.java2
-rw-r--r--src/main/resources/maps/level0.txt13
-rw-r--r--src/main/resources/maps/level1.txt13
-rw-r--r--src/main/resources/maps/level2.txt13
-rw-r--r--src/main/resources/maps/level3.txt13
6 files changed, 55 insertions, 2 deletions
diff --git a/src/main/java/fr/umlv/java/wallj/board/BoardValidator.java b/src/main/java/fr/umlv/java/wallj/board/BoardValidator.java
index e238955..e95446b 100644
--- a/src/main/java/fr/umlv/java/wallj/board/BoardValidator.java
+++ b/src/main/java/fr/umlv/java/wallj/board/BoardValidator.java
@@ -91,7 +91,8 @@ public class BoardValidator {
91 .filter(blockEntry -> blockEntry.getValue().mustBeReachable()) 91 .filter(blockEntry -> blockEntry.getValue().mustBeReachable())
92 .allMatch(blockEntry -> blockEntry.getKey().neighbors().stream() 92 .allMatch(blockEntry -> blockEntry.getKey().neighbors().stream()
93 .filter(neighbor -> inBoard(dim, neighbor)) 93 .filter(neighbor -> inBoard(dim, neighbor))
94 .anyMatch(neighbor -> b.getBlockTypeAt(neighbor).isTraversable())); 94 .anyMatch(neighbor -> b.getBlockTypeAt(neighbor).isTraversable() ||
95 b.getBlockTypeAt(neighbor).isMovableByExplosion()));
95 } 96 }
96 97
97 /** 98 /**
diff --git a/src/main/java/fr/umlv/java/wallj/model/BlockType.java b/src/main/java/fr/umlv/java/wallj/model/BlockType.java
index 9051715..9c5d4f5 100644
--- a/src/main/java/fr/umlv/java/wallj/model/BlockType.java
+++ b/src/main/java/fr/umlv/java/wallj/model/BlockType.java
@@ -10,7 +10,7 @@ public enum BlockType {
10 FREE(false, true, true, false), 10 FREE(false, true, true, false),
11 WALL(true, false, false, false), 11 WALL(true, false, false, false),
12 TRASH(true, true, false, false), 12 TRASH(true, true, false, false),
13 GARBAGE(false, true, true, true), 13 GARBAGE(false, true, false, true),
14 ROBOT(false, false, true, false), 14 ROBOT(false, false, true, false),
15 BOMB(false, false, true, false); 15 BOMB(false, false, true, false);
16 16
diff --git a/src/main/resources/maps/level0.txt b/src/main/resources/maps/level0.txt
new file mode 100644
index 0000000..aa53f62
--- /dev/null
+++ b/src/main/resources/maps/level0.txt
@@ -0,0 +1,13 @@
1WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
2W W
3T T
4T T
5T T
6T G T
7T G T
8T G T
9T T
10T T
11T T
12W W
13WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW \ No newline at end of file
diff --git a/src/main/resources/maps/level1.txt b/src/main/resources/maps/level1.txt
new file mode 100644
index 0000000..7e8e3fb
--- /dev/null
+++ b/src/main/resources/maps/level1.txt
@@ -0,0 +1,13 @@
1WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
2W W
3W W
4W W
5W W W
6W G WT W
7W G WT W
8W G WT W
9W W W
10W W
11W W
12W W
13WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW \ No newline at end of file
diff --git a/src/main/resources/maps/level2.txt b/src/main/resources/maps/level2.txt
new file mode 100644
index 0000000..bb41492
--- /dev/null
+++ b/src/main/resources/maps/level2.txt
@@ -0,0 +1,13 @@
1WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
2W W
3W WW W
4W G W W
5W W
6W TTT G W
7W W TWT W
8W TTT W
9W W W
10W WW W
11W G WW W W
12W W
13WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW \ No newline at end of file
diff --git a/src/main/resources/maps/level3.txt b/src/main/resources/maps/level3.txt
new file mode 100644
index 0000000..08f8aef
--- /dev/null
+++ b/src/main/resources/maps/level3.txt
@@ -0,0 +1,13 @@
1WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
2W W
3W GGGG G G G GGGGG W
4W G G G G G W
5W G GG G GGGGG GGG W
6W G G G G G G W
7W GGGG GGGG G G G W
8W W
9WWWWWWWWWWWWWWWWWWWWWWWWWWWWW W
10W W
11W T W
12W W
13WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW \ No newline at end of file