summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank/game/battles
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/tankontank/game/battles')
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java18
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java20
2 files changed, 11 insertions, 27 deletions
diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java b/core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java
index 9942289..1297def 100644
--- a/core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java
+++ b/core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java
@@ -71,24 +71,16 @@ public class BattleFrontalAssault extends BattleCommon
}
if (count > 1)
- return (ctrl.player.is(Army.US) ? ctrl.player : ctrl.opponent);
+ return ctrl.getPlayer(Army.US);
else
- return (ctrl.player.is(Army.GE) ? ctrl.player : ctrl.opponent);
+ return ctrl.getPlayer(Army.GE);
}
@Override
- public void setup(Map map, Player a, Player b)
+ public void setup(Ctrl ctrl, Map map)
{
- Player gePlayer;
- Player usPlayer;
-
- if (a.is(Army.US)) {
- usPlayer = a;
- gePlayer = b;
- } else {
- usPlayer = b;
- gePlayer = a;
- }
+ Player gePlayer = ctrl.getPlayer(Army.GE);
+ Player usPlayer = ctrl.getPlayer(Army.US);
objectives = new TileSet(map, 3);
objectives.add(map.getHex(2, 2));
diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java b/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java
index c77d0e8..2307486 100644
--- a/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java
+++ b/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java
@@ -76,21 +76,13 @@ public class BattleHeadToHead extends BattleCommon
}
@Override
- public void setup(Map map, Player a, Player b)
+ public void setup(Ctrl ctrl, Map map)
{
- Player gePlayer;
- Player usPlayer;
-
- a.deploymentDone();
- b.deploymentDone();
-
- if (a.is(Army.US)) {
- usPlayer = a;
- gePlayer = b;
- } else {
- usPlayer = b;
- gePlayer = a;
- }
+ Player gePlayer = ctrl.getPlayer(Army.GE);
+ Player usPlayer = ctrl.getPlayer(Army.US);
+
+ gePlayer.deploymentDone();
+ usPlayer.deploymentDone();
objectives = new TileSet(map, 3);
objectives.add(map.getHex(7, 7));