diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-10-30 14:04:04 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-10-30 14:04:04 +0100 |
commit | 9dd2e3d2325da7b9e1c6c41f3dfb86341b00c899 (patch) | |
tree | 6db7772f7ea040a144d678de1d8df3dd38f83154 /core/test/ch | |
parent | df7569c614fcea80e6a25dd0749a75d5ba00a68e (diff) | |
download | RustAndDust-9dd2e3d2325da7b9e1c6c41f3dfb86341b00c899.zip RustAndDust-9dd2e3d2325da7b9e1c6c41f3dfb86341b00c899.tar.gz |
tests: check LOS is ok when dst is blocked
Diffstat (limited to 'core/test/ch')
-rw-r--r-- | core/test/ch/asynk/rustanddust/LineOfSightTest.java | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/core/test/ch/asynk/rustanddust/LineOfSightTest.java b/core/test/ch/asynk/rustanddust/LineOfSightTest.java index 2722c45..fce9605 100644 --- a/core/test/ch/asynk/rustanddust/LineOfSightTest.java +++ b/core/test/ch/asynk/rustanddust/LineOfSightTest.java @@ -1450,6 +1450,14 @@ public class LineOfSightTest checkNode(s, 3, to.col, to.row); block(blockB.col, blockB.row, false); + // block to + block(to.col, to.row, true); + s = lineOfSight(from.col, from.row, to.col, to.row); + assertTrue(s.size() == 4); + checkNode(s, 0, from.col, from.row); + checkNode(s, 3, to.col, to.row); + block(to.col, to.row, false); + // block A and B block(blockA.col, blockA.row, true); block(blockB.col, blockB.row, true); @@ -1482,6 +1490,14 @@ public class LineOfSightTest checkNode(s, 3, from.col, from.row); block(blockB.col, blockB.row, false); + // block from + block(from.col, from.row, true); + s = lineOfSight(from.col, from.row, to.col, to.row); + assertTrue(s.size() == 4); + checkNode(s, 0, from.col, from.row); + checkNode(s, 3, to.col, to.row); + block(from.col, from.row, false); + // block A and B block(blockA.col, blockA.row, true); block(blockB.col, blockB.row, true); |