diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-30 01:13:19 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-30 01:13:19 +0200 |
commit | 2a00944af0e955e23e48fa2c3bd1f1d20c179df9 (patch) | |
tree | 1b1fdf65bc525ff69c51f249d947aa826aae3edd | |
parent | e7fd685dc2ec8f8f99624d7de9cb205fd082bcbc (diff) | |
download | RustAndDust-2a00944af0e955e23e48fa2c3bd1f1d20c179df9.zip RustAndDust-2a00944af0e955e23e48fa2c3bd1f1d20c179df9.tar.gz |
SearchBoard: remove useless check param for lineOfSight()
-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 |