diff options
author | pacien | 2018-02-02 10:56:15 +0100 |
---|---|---|
committer | pacien | 2018-02-02 10:56:15 +0100 |
commit | 726a4ba8047be847e0bc3af7b376f41d2760b635 (patch) | |
tree | 41bbdf583e57745925c7434d6989b4073c8a200d | |
parent | 5615f448a69a47de0be4a4f626770cd45752384f (diff) | |
download | wallj-726a4ba8047be847e0bc3af7b376f41d2760b635.tar.gz |
Remove criticism
Signed-off-by: pacien <pacien.trangirard@pacien.net>
-rw-r--r-- | src/test/java/fr/umlv/java/wallj/board/PathFinderTest.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/java/fr/umlv/java/wallj/board/PathFinderTest.java b/src/test/java/fr/umlv/java/wallj/board/PathFinderTest.java index 3af4679..be615b7 100644 --- a/src/test/java/fr/umlv/java/wallj/board/PathFinderTest.java +++ b/src/test/java/fr/umlv/java/wallj/board/PathFinderTest.java | |||
@@ -7,6 +7,7 @@ import java.io.IOException; | |||
7 | import java.net.URISyntaxException; | 7 | import java.net.URISyntaxException; |
8 | import java.nio.file.Path; | 8 | import java.nio.file.Path; |
9 | import java.nio.file.Paths; | 9 | import java.nio.file.Paths; |
10 | import java.util.ArrayList; | ||
10 | import java.util.List; | 11 | import java.util.List; |
11 | 12 | ||
12 | /** | 13 | /** |
@@ -19,8 +20,10 @@ final class PathFinderTest { | |||
19 | } | 20 | } |
20 | 21 | ||
21 | private boolean isPathConnected(List<TileVec2> path) { | 22 | private boolean isPathConnected(List<TileVec2> path) { |
22 | for (int i = 1; i < path.size(); ++i) { | 23 | List<TileVec2> runPath = new ArrayList<>(path); |
23 | TileVec2 predecessor = path.get(i - 1), current = path.get(i); | 24 | |
25 | for (int i = 1; i < runPath.size(); ++i) { | ||
26 | TileVec2 predecessor = runPath.get(i - 1), current = runPath.get(i); | ||
24 | 27 | ||
25 | if (Math.abs(predecessor.getCol() - current.getCol()) > 1 || | 28 | if (Math.abs(predecessor.getCol() - current.getCol()) > 1 || |
26 | Math.abs(predecessor.getRow() - current.getRow()) > 1) return false; | 29 | Math.abs(predecessor.getRow() - current.getRow()) > 1) return false; |