diff options
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/fr/umlv/java/wallj/board/BoardValidator.java | 3 | ||||
-rw-r--r-- | src/main/java/fr/umlv/java/wallj/model/BlockType.java | 2 | ||||
-rw-r--r-- | src/main/resources/maps/level0.txt | 13 | ||||
-rw-r--r-- | src/main/resources/maps/level1.txt | 13 | ||||
-rw-r--r-- | src/main/resources/maps/level2.txt | 13 | ||||
-rw-r--r-- | src/main/resources/maps/level3.txt | 13 |
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 @@ | |||
1 | WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW | ||
2 | W W | ||
3 | T T | ||
4 | T T | ||
5 | T T | ||
6 | T G T | ||
7 | T G T | ||
8 | T G T | ||
9 | T T | ||
10 | T T | ||
11 | T T | ||
12 | W W | ||
13 | WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW \ 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 @@ | |||
1 | WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW | ||
2 | W W | ||
3 | W W | ||
4 | W W | ||
5 | W W W | ||
6 | W G WT W | ||
7 | W G WT W | ||
8 | W G WT W | ||
9 | W W W | ||
10 | W W | ||
11 | W W | ||
12 | W W | ||
13 | WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW \ 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 @@ | |||
1 | WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW | ||
2 | W W | ||
3 | W WW W | ||
4 | W G W W | ||
5 | W W | ||
6 | W TTT G W | ||
7 | W W TWT W | ||
8 | W TTT W | ||
9 | W W W | ||
10 | W WW W | ||
11 | W G WW W W | ||
12 | W W | ||
13 | WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW \ 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 @@ | |||
1 | WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW | ||
2 | W W | ||
3 | W GGGG G G G GGGGG W | ||
4 | W G G G G G W | ||
5 | W G GG G GGGGG GGG W | ||
6 | W G G G G G G W | ||
7 | W GGGG GGGG G G G W | ||
8 | W W | ||
9 | WWWWWWWWWWWWWWWWWWWWWWWWWWWWW W | ||
10 | W W | ||
11 | W T W | ||
12 | W W | ||
13 | WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW \ No newline at end of file | ||