diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-01 10:05:38 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-01 10:05:38 +0200 |
commit | 46b0fbb938636ed24ac93ffc4a07db2d515541ce (patch) | |
tree | 55c9a8e52809656c98d07384c28e4d9cffda0f63 | |
parent | f9666a530c1834f23f64d4a0bd34eeab066c0560 (diff) | |
download | RustAndDust-46b0fbb938636ed24ac93ffc4a07db2d515541ce.zip RustAndDust-46b0fbb938636ed24ac93ffc4a07db2d515541ce.tar.gz |
SearchBoard: add distance(Node, Node)
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/SearchBoard.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/SearchBoard.java b/core/src/ch/asynk/tankontank/engine/SearchBoard.java index 536ea85..8c5b93a 100644 --- a/core/src/ch/asynk/tankontank/engine/SearchBoard.java +++ b/core/src/ch/asynk/tankontank/engine/SearchBoard.java @@ -92,6 +92,11 @@ public class SearchBoard return nodes[((col - colOffset)) + (row * cols)]; } + public int distance(Node from, Node to) + { + return distance(from.col, from.row, to.col, to.row); + } + public int distance(int col0, int row0, int col1, int row1) { int dx = Math.abs(col1 - col0); |