From 2a00944af0e955e23e48fa2c3bd1f1d20c179df9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 30 Sep 2014 01:13:19 +0200 Subject: SearchBoard: remove useless check param for lineOfSight() --- core/src/ch/asynk/tankontank/engine/SearchBoard.java | 13 ++++--------- 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 lineOfSight(int x0, int y0, int x1, int y1) { - return lineOfSight(x0, y0, x1, y1, true); - } - - public List 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 verticalLineOfSight(int x0, int y0, int x1, int y1, boolean check) + private List 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 diagonalLineOfSight(int x0, int y0, int x1, int y1, boolean check) + private List 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 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 -- cgit v1.1-2-g2b99