summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-10-29 15:38:25 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-10-29 15:38:25 +0100
commita3ec9e5ff30ff657597b2c746733fc0ac97fc805 (patch)
tree8763790030e1573811e06fb122ba8f5fcdb32575
parentcca3699fa58a9fd12fa9a3d3957458c6d3a93ec2 (diff)
downloadRustAndDust-a3ec9e5ff30ff657597b2c746733fc0ac97fc805.zip
RustAndDust-a3ec9e5ff30ff657597b2c746733fc0ac97fc805.tar.gz
SearchBoard : add buildLineOfSight(...) needed for tests
-rw-r--r--core/src/ch/asynk/rustanddust/engine/SearchBoard.java6
-rw-r--r--core/test/ch/asynk/rustanddust/LineOfSightTest.java2
2 files changed, 7 insertions, 1 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/SearchBoard.java b/core/src/ch/asynk/rustanddust/engine/SearchBoard.java
index f869e32..6a1e6bb 100644
--- a/core/src/ch/asynk/rustanddust/engine/SearchBoard.java
+++ b/core/src/ch/asynk/rustanddust/engine/SearchBoard.java
@@ -260,6 +260,12 @@ public class SearchBoard
a[5] = null;
}
+ public List<Node> buildLineOfSight(int x0, int y0, int x1, int y1, boolean clearVisibility)
+ {
+ lineOfSight(x0, y0, x1, y1, clearVisibility);
+ return los;
+ }
+
public int possibleTargetsFrom(Pawn shooter, Collection<Pawn> targets)
{
targets.clear();
diff --git a/core/test/ch/asynk/rustanddust/LineOfSightTest.java b/core/test/ch/asynk/rustanddust/LineOfSightTest.java
index 86a85df..2722c45 100644
--- a/core/test/ch/asynk/rustanddust/LineOfSightTest.java
+++ b/core/test/ch/asynk/rustanddust/LineOfSightTest.java
@@ -37,7 +37,7 @@ public class LineOfSightTest
private List<Node> lineOfSight(int x0, int y0, int x1, int y1)
{
- return sb.lineOfSight(x0, y0, x1, y1, true);
+ return sb.buildLineOfSight(x0, y0, x1, y1, true);
}
// from bottom left