diff options
6 files changed, 21 insertions, 21 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index a032ac9..1eb68dd 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -255,7 +255,7 @@ public abstract class Board implements Disposable debugShapes.setTransformMatrix(prevTransform); } - protected int buildPossibleMoves(Pawn pawn, TileCollection moves) + protected int collectPossibleMoves(Pawn pawn, TileCollection moves) { Tile from = pawn.getTile(); Set<SearchBoard.Node> nodes = searchBoard.possibleMovesFrom(pawn, from.getCol(), from.getRow()); @@ -277,7 +277,7 @@ public abstract class Board implements Disposable Pawn target = units.next(); if (!target.canBeAttacked(pawn)) continue; Tile to = target.getTile(); - if (searchBoard.buildAttack(pawn, true, target, from.getCol(), from.getRow(), to.getCol(), to.getRow())) + if (searchBoard.collectAttack(pawn, true, target, from.getCol(), from.getRow(), to.getCol(), to.getRow())) targets.add(target); } @@ -310,7 +310,7 @@ public abstract class Board implements Disposable Pawn p = units.next(); if ((p == pawn) || !p.canAttack()) continue; Tile from = p.getTile(); - if (searchBoard.buildAttack(p, !p.canAssistAttackWithoutLos(), target, from.getCol(), from.getRow(), to.getCol(), to.getRow())) { + if (searchBoard.collectAttack(p, !p.canAssistAttackWithoutLos(), target, from.getCol(), from.getRow(), to.getCol(), to.getRow())) { if (p != pawn) assists.add(p); } @@ -335,7 +335,7 @@ public abstract class Board implements Disposable return nodes.size(); } - protected int buildPossiblePaths(Pawn pawn, Tile to, TileCollection tiles) + protected int collectPossiblePaths(Pawn pawn, Tile to, TileCollection tiles) { Tile from = pawn.getTile(); paths = searchBoard.possiblePaths(pawn, from.getCol(), from.getRow(), to.getCol(), to.getRow()); diff --git a/core/src/ch/asynk/tankontank/engine/SearchBoard.java b/core/src/ch/asynk/tankontank/engine/SearchBoard.java index 668899b..524614a 100644 --- a/core/src/ch/asynk/tankontank/engine/SearchBoard.java +++ b/core/src/ch/asynk/tankontank/engine/SearchBoard.java @@ -347,7 +347,7 @@ public class SearchBoard return targets; } - public boolean buildAttack(Pawn pawn, boolean clearVisibility, Pawn target, int col0, int row0, int col1, int row1) + public boolean collectAttack(Pawn pawn, boolean clearVisibility, Pawn target, int col0, int row0, int col1, int row1) { pawn.attack.isClear = false; pawn.attack.target = target; diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index cf48870..8e92966 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -93,18 +93,18 @@ public abstract class Map extends Board return (Hex) getTile(col, row); } - public int buildPossibleMoves(Pawn pawn) + public int collectPossibleMoves(Pawn pawn) { if (!pawn.canMove()) { possibleMoves.clear(); return 0; } - return buildPossibleMoves(pawn, possibleMoves); + return collectPossibleMoves(pawn, possibleMoves); } - public int buildPossiblePaths(Pawn pawn, Hex to) + public int collectPossiblePaths(Pawn pawn, Hex to) { - return buildPossiblePaths(pawn, to, possiblePaths); + return collectPossiblePaths(pawn, to, possiblePaths); } public int possiblePathsPointToggle(Hex hex) @@ -112,7 +112,7 @@ public abstract class Map extends Board return possiblePathsFilterToggle(hex, possiblePaths); } - public int buildPossibleTargets(Pawn pawn, Iterator<Pawn> foes) + public int collectPossibleTargets(Pawn pawn, Iterator<Pawn> foes) { if (!pawn.canAttack()) { possibleTargets.clear(); @@ -154,11 +154,11 @@ public abstract class Map extends Board } } - public void buildAndShowMovesAndAssits(Pawn pawn) + public void collectAndShowMovesAndAssits(Pawn pawn) { hidePossibleMoves(); hideMoveablePawns(); - buildPossibleMoves(pawn); + collectPossibleMoves(pawn); collectMoveablePawns(pawn); showPossibleMoves(); showMoveablePawns(); diff --git a/core/src/ch/asynk/tankontank/game/states/StateAttack.java b/core/src/ch/asynk/tankontank/game/states/StateAttack.java index b3e19e2..84ee3d8 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateAttack.java +++ b/core/src/ch/asynk/tankontank/game/states/StateAttack.java @@ -18,7 +18,7 @@ public class StateAttack extends StateCommon activeUnit = null; // use selectedHex and selectedUnit map.hidePossibleTargets(); - map.buildPossibleTargets(selectedUnit, ctrl.opponent.unitIterator()); + map.collectPossibleTargets(selectedUnit, ctrl.opponent.unitIterator()); map.showPossibleTargets(); if (to != null) { // quick fire -> replay touchUp diff --git a/core/src/ch/asynk/tankontank/game/states/StateMove.java b/core/src/ch/asynk/tankontank/game/states/StateMove.java index 6caf096..bce5baf 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateMove.java +++ b/core/src/ch/asynk/tankontank/game/states/StateMove.java @@ -18,7 +18,7 @@ public class StateMove extends StateCommon // use selectedHex and selectedUnit activeUnit = selectedUnit; activeUnit.showMoveable(); - map.buildAndShowMovesAndAssits(activeUnit); + map.collectAndShowMovesAndAssits(activeUnit); if (to != null) { // quick move -> replay touchUp upHex = to; @@ -68,7 +68,7 @@ public class StateMove extends StateCommon if(unit != activeUnit) changeUnit(unit); } else if ((s == 0) && map.possibleMoves.contains(upHex)) { - s = buildPaths(); + s = collectPaths(); } else if (map.possiblePaths.contains(upHex)) { s = togglePoint(s); } @@ -113,14 +113,14 @@ public class StateMove extends StateCommon map.hideAssist(hex); activeUnit.showMoveable(); map.hidePossibleMoves(); - map.buildPossibleMoves(activeUnit); + map.collectPossibleMoves(activeUnit); map.showPossibleMoves(); } - private int buildPaths() + private int collectPaths() { to = upHex; - int s = map.buildPossiblePaths(activeUnit, to); + int s = map.collectPossiblePaths(activeUnit, to); map.selectHex(to); map.hidePossibleMoves(); map.showPossiblePaths(); diff --git a/core/src/ch/asynk/tankontank/game/states/StateSelect.java b/core/src/ch/asynk/tankontank/game/states/StateSelect.java index 0fa45de..3e5c1b8 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateSelect.java +++ b/core/src/ch/asynk/tankontank/game/states/StateSelect.java @@ -54,12 +54,12 @@ public class StateSelect extends StateCommon if (hasUnit() && (!isEnemy || ctrl.cfg.showEnemyPossibilities)) { // moves and targets == 0 if selectedUnit can't be activated for - int moves = map.buildPossibleMoves(selectedUnit); + int moves = map.collectPossibleMoves(selectedUnit); int targets = 0; if (isEnemy) - targets = map.buildPossibleTargets(selectedUnit, ctrl.player.unitIterator()); + targets = map.collectPossibleTargets(selectedUnit, ctrl.player.unitIterator()); else - targets = map.buildPossibleTargets(selectedUnit, ctrl.opponent.unitIterator()); + targets = map.collectPossibleTargets(selectedUnit, ctrl.opponent.unitIterator()); if (moves > 0) map.collectMoveablePawns(selectedUnit); showPossibleTargetsMovesAssists(selectedUnit); |