summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/game/Battle.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/Ctrl.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/BattleFrontalAssault.java18
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java20
4 files changed, 13 insertions, 29 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Battle.java b/core/src/ch/asynk/tankontank/game/Battle.java
index 13e3162..7e52632 100644
--- a/core/src/ch/asynk/tankontank/game/Battle.java
+++ b/core/src/ch/asynk/tankontank/game/Battle.java
@@ -25,5 +25,5 @@ public interface Battle
public boolean deploymentDone(Player player);
- public void setup(Map map, Player firstPlayer, Player secondPlayer);
+ public void setup(Ctrl ctrl, Map map);
}
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java
index 78fdeba..77bc56f 100644
--- a/core/src/ch/asynk/tankontank/game/Ctrl.java
+++ b/core/src/ch/asynk/tankontank/game/Ctrl.java
@@ -56,7 +56,7 @@ public class Ctrl implements Disposable
this.player = battle.getPlayer(true, false);
this.opponent = battle.getPlayer(false, false);
this.map = battle.getMap();
- battle.setup(map, player, opponent);
+ battle.setup(this, map);
this.selectState = new StateSelect(this, map);
this.pathState = new StateMove();
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));