diff options
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/SearchBoard.java | 13 | ||||
-rw-r--r-- | core/test/ch/asynk/tankontank/LineOfSightTest.java | 2 |
2 files changed, 5 insertions, 10 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/SearchBoard.java b/core/src/ch/asynk/tankontank/engine/SearchBoard.java index 57e75cf..20b7d73 100644 --- a/core/src/ch/asynk/tankontank/engine/SearchBoard.java +++ b/core/src/ch/asynk/tankontank/engine/SearchBoard.java @@ -288,11 +288,6 @@ public class SearchBoard public List<Node> lineOfSight(int x0, int y0, int x1, int y1) { - return lineOfSight(x0, y0, x1, y1, true); - } - - public List<Node> lineOfSight(int x0, int y0, int x1, int y1, boolean check) - { los.clear(); // orthogonal axis @@ -319,9 +314,9 @@ public class SearchBoard } if (dx == 0) - return verticalLineOfSight(x0, y0, x1, y1, check); + return verticalLineOfSight(x0, y0, x1, y1); if (dx == (3 * dy)) - return diagonalLineOfSight(x0, y0, x1, y1, check); + return diagonalLineOfSight(x0, y0, x1, y1); int dx3 = 3 * dx; int dy3 = 3 * dy; @@ -363,7 +358,7 @@ public class SearchBoard return los; } - private List<Node> verticalLineOfSight(int x0, int y0, int x1, int y1, boolean check) + private List<Node> verticalLineOfSight(int x0, int y0, int x1, int y1) { int d = ( (y1 > y0) ? 1 : -1); int x = x0; @@ -388,7 +383,7 @@ public class SearchBoard return los; } - private List<Node> diagonalLineOfSight(int x0, int y0, int x1, int y1, boolean check) + private List<Node> diagonalLineOfSight(int x0, int y0, int x1, int y1) { int dy = ( (y1 > y0) ? 1 : -1); int dx = ( (x1 > x0) ? 1 : -1); diff --git a/core/test/ch/asynk/tankontank/LineOfSightTest.java b/core/test/ch/asynk/tankontank/LineOfSightTest.java index a3acf57..8c15908 100644 --- a/core/test/ch/asynk/tankontank/LineOfSightTest.java +++ b/core/test/ch/asynk/tankontank/LineOfSightTest.java @@ -94,7 +94,7 @@ public class LineOfSightTest private List<Node> lineOfSight(int x0, int y0, int x1, int y1) { - return sb.lineOfSight(x0, y0, x1, y1, false); + return sb.lineOfSight(x0, y0, x1, y1); } // from bottom left |