From 46b0fbb938636ed24ac93ffc4a07db2d515541ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 1 Oct 2014 10:05:38 +0200 Subject: SearchBoard: add distance(Node, Node) --- core/src/ch/asynk/tankontank/engine/SearchBoard.java | 5 +++++ 1 file changed, 5 insertions(+) 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); -- cgit v1.1-2-g2b99