summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-29 22:50:07 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-29 22:50:07 +0100
commit4a2ea387eca2562ebda13b2456aa29ad4659d1e8 (patch)
tree6fd7cb258e84de941cf6d0159e4ec5d17cbf959e /core/src/ch/asynk/tankontank/game
parentfe4be61e3985ae3739237cfecb16dcb8fa79551e (diff)
downloadRustAndDust-4a2ea387eca2562ebda13b2456aa29ad4659d1e8.zip
RustAndDust-4a2ea387eca2562ebda13b2456aa29ad4659d1e8.tar.gz
rename buildXxxYyy(...) -> collectXxxYyy(...)
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java14
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateAttack.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateMove.java10
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StateSelect.java6
4 files changed, 16 insertions, 16 deletions
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);