diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
6 files changed, 12 insertions, 12 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java index 168d07d..f405845 100644 --- a/core/src/ch/asynk/tankontank/game/Map.java +++ b/core/src/ch/asynk/tankontank/game/Map.java @@ -1,6 +1,6 @@ package ch.asynk.tankontank.game; -import java.util.Iterator; +import java.util.List; import java.util.Random; import com.badlogic.gdx.audio.Sound; @@ -118,7 +118,7 @@ public abstract class Map extends Board return possiblePaths.toggleCtrlTile(hex); } - public int collectPossibleTargets(Pawn pawn, Iterator<Pawn> foes) + public int collectPossibleTargets(Pawn pawn, List<Pawn> foes) { if (!pawn.canEngage()) { possibleTargets.clear(); @@ -140,7 +140,7 @@ public abstract class Map extends Board return moveablePawns.size(); } - public int collectAttackAssists(Pawn pawn, Pawn target, Iterator<Pawn> units) + public int collectAttackAssists(Pawn pawn, Pawn target, List<Pawn> units) { int s = collectAttackAssists(pawn, target, units, engagementAssists); activatedPawns.add(pawn); diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java b/core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java index f31aff4..4571772 100644 --- a/core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java +++ b/core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java @@ -47,7 +47,7 @@ public class BattleFrontalAssault extends BattleCommon @Override public boolean deploymentDone(Player player) { - int n = player.getReinforcement().size(); + int n = player.reinforcement(); if (n == 0) { player.deploymentDone(); return true; diff --git a/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java b/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java index 5cd4b5f..4ac8c88 100644 --- a/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java +++ b/core/src/ch/asynk/tankontank/game/hud/PlayerInfo.java @@ -95,7 +95,7 @@ public class PlayerInfo implements Disposable, Drawable unitDock.hide(); turns.write("" + player.getTurn()); aps.write("" + player.getAp()); - int r = player.getReinforcement().size(); + int r = player.reinforcement(); if (r == 0) { reinforcement.visible = false; } else { @@ -103,7 +103,7 @@ public class PlayerInfo implements Disposable, Drawable reinforcement.write("" + r); } - if (player.getFaction() == Army.GE) + if (player.is(Army.GE)) flag = geFlag; else flag = usFlag; diff --git a/core/src/ch/asynk/tankontank/game/hud/UnitDock.java b/core/src/ch/asynk/tankontank/game/hud/UnitDock.java index 0e67630..ce2ac04 100644 --- a/core/src/ch/asynk/tankontank/game/hud/UnitDock.java +++ b/core/src/ch/asynk/tankontank/game/hud/UnitDock.java @@ -96,9 +96,9 @@ public class UnitDock extends Bg { float x = position.getX(rect.width * SCALE); if (done) { - pawns = ctrl.player.getReinforcement(); - if(pawns.size() == 0) + if(ctrl.player.reinforcement() == 0) return; + pawns = ctrl.player.reinforcement; rect.width = pawns.get(0).getWidth() + (2 * padding); rect.height = ((pawns.get(0).getHeight() * pawns.size()) + ((pawns.size() + 1) * padding)); rect.x = (position.isLeft() ? (0 - (rect.width * SCALE)) : (x + (rect.width * SCALE))); diff --git a/core/src/ch/asynk/tankontank/game/states/StateEngage.java b/core/src/ch/asynk/tankontank/game/states/StateEngage.java index 1586d80..4b1539b 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateEngage.java +++ b/core/src/ch/asynk/tankontank/game/states/StateEngage.java @@ -19,7 +19,7 @@ public class StateEngage extends StateCommon activeUnit = null; // use selectedHex and selectedUnit map.hidePossibleTargets(); - map.collectPossibleTargets(selectedUnit, ctrl.opponent.unitIterator()); + map.collectPossibleTargets(selectedUnit, ctrl.opponent.units); map.showPossibleTargets(); if (to != null) { // quick fire -> replay touchUp @@ -89,7 +89,7 @@ public class StateEngage extends StateCommon to = upHex; activeUnit = unit; activeUnit.showTarget(); - map.collectAttackAssists(selectedUnit, activeUnit, ctrl.player.unitIterator()); + map.collectAttackAssists(selectedUnit, activeUnit, ctrl.player.units); map.showAttackAssists(); ctrl.hud.actionButtons.show(Buttons.ENGAGE.b | Buttons.DONE.b | ((ctrl.cfg.canCancel) ? Buttons.ABORT.b : 0)); } diff --git a/core/src/ch/asynk/tankontank/game/states/StateSelect.java b/core/src/ch/asynk/tankontank/game/states/StateSelect.java index 7e7059e..7bdc815 100644 --- a/core/src/ch/asynk/tankontank/game/states/StateSelect.java +++ b/core/src/ch/asynk/tankontank/game/states/StateSelect.java @@ -77,9 +77,9 @@ public class StateSelect extends StateCommon int moves = map.collectPossibleMoves(selectedUnit); int targets = 0; if (isEnemy) - targets = map.collectPossibleTargets(selectedUnit, ctrl.player.unitIterator()); + targets = map.collectPossibleTargets(selectedUnit, ctrl.player.units); else - targets = map.collectPossibleTargets(selectedUnit, ctrl.opponent.unitIterator()); + targets = map.collectPossibleTargets(selectedUnit, ctrl.opponent.units); if (moves > 0) map.collectMoveablePawns(selectedUnit); showPossibilities(selectedUnit); |