summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/src/ch/asynk/tankontank/engine/Board.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java
index e709bff..6bab3d0 100644
--- a/core/src/ch/asynk/tankontank/engine/Board.java
+++ b/core/src/ch/asynk/tankontank/engine/Board.java
@@ -306,6 +306,21 @@ public abstract class Board extends Image implements Disposable
return areaPoints;
}
+ public List<GridPoint2> openToAttackFrom(Pawn pawn, int col, int row)
+ {
+ for (GridPoint2 p : areaPoints)
+ gridPoint2Pool.free(p);
+ areaPoints.clear();
+
+ for (SearchBoard.Node node : searchBoard.openToAttackFrom(pawn, col, row)) {
+ GridPoint2 point = gridPoint2Pool.obtain();
+ point.set(node.col, node.row);
+ areaPoints.add(point);
+ }
+
+ return areaPoints;
+ }
+
public void clearOverlaysOn(int col, int row)
{
clearOverlaysOn(getTile(col, row));