diff options
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/SearchBoard.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/SearchBoard.java b/core/src/ch/asynk/tankontank/engine/SearchBoard.java index fea114a..536ea85 100644 --- a/core/src/ch/asynk/tankontank/engine/SearchBoard.java +++ b/core/src/ch/asynk/tankontank/engine/SearchBoard.java @@ -71,6 +71,18 @@ public class SearchBoard this.los = new Vector<Node>(10); } + private boolean inMap(int col, int row) + { + if ((row < 0) || (row >= rows)) + return false; + + int colOffset = ((row + 1) / 2); + if ((col < colOffset) || ((col - colOffset) >= cols)) + return false; + + return true; + } + private Node getNode(int col, int row) { int colOffset = ((row + 1) / 2); |