diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-16 16:21:34 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-16 16:21:34 +0100 |
commit | 77a2f3c56ff1f7faa9a60df239c35c502780b67f (patch) | |
tree | 363f1ad426f1a3473ec48fa53ef345ac4e0c06f9 /core/src | |
parent | d45fe0d6b1ad80016a4b85709e8d0ec7b15f410d (diff) | |
download | RustAndDust-77a2f3c56ff1f7faa9a60df239c35c502780b67f.zip RustAndDust-77a2f3c56ff1f7faa9a60df239c35c502780b67f.tar.gz |
Battle: setup(Map, Player, Player) -> setup(Ctrl, Map)
Diffstat (limited to 'core/src')
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)); |