diff options
author | Adam NAILI | 2018-01-14 22:12:26 +0100 |
---|---|---|
committer | Adam NAILI | 2018-01-14 22:12:26 +0100 |
commit | 36d9bdb9ea9ae1447fd836735be93b4f96b28b0f (patch) | |
tree | eefb1e39539accc6fe0a4f2e72d81ce8275497bd /src/main/java/fr | |
parent | d1c6b2f6a9fe6af75f1668e25d96ec4380f69f76 (diff) | |
parent | e79dd7a94448467b1a5582a47b84cd3dc320f54d (diff) | |
download | wallj-36d9bdb9ea9ae1447fd836735be93b4f96b28b0f.tar.gz |
Merge branch 'master' of https://github.com/pacien/upem-java-wallj
Diffstat (limited to 'src/main/java/fr')
-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 |
2 files changed, 3 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 | ||