From cb5e7eb16dafeecb9c1750139af873a5d0d148c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 13 Oct 2014 16:55:53 +0200 Subject: Board: buildxxx(...) retrun count of collected elements --- core/src/ch/asynk/tankontank/engine/Board.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index dcb628a..6c5fb63 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -315,19 +315,21 @@ public abstract class Board implements Disposable } } - protected void buildPossibleMovesFrom(Pawn pawn, GridPoint2 coords, ArrayList moves) + protected int buildPossibleMovesFrom(Pawn pawn, GridPoint2 coords, ArrayList moves) { List nodes = searchBoard.possibleMovesFrom(pawn, coords.x, coords.y); nodesToPoints(nodes, moves); + return moves.size(); } - protected void buildPossibleTargetsFrom(Pawn pawn, GridPoint2 coords, ArrayList targets) + protected int buildPossibleTargetsFrom(Pawn pawn, GridPoint2 coords, ArrayList targets) { List nodes = searchBoard.possibleTargetsFrom(pawn, coords.x, coords.y); nodesToPoints(nodes, targets); + return targets.size(); } - protected void buildMoveAssists(Pawn pawn, GridPoint2 coords, List assists) + protected int buildMoveAssists(Pawn pawn, GridPoint2 coords, List assists) { assists.clear(); buildNeighboursFor(coords); @@ -341,6 +343,7 @@ public abstract class Board implements Disposable } } } + return assists.size(); } protected void buildAttackAssists(Pawn pawn, GridPoint2 hex, Iterator units, ArrayList assists) -- cgit v1.1-2-g2b99