summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-16 13:22:23 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-16 13:22:23 +0100
commitc95a74ec7b5954881bad3a1c6e0a4fa3a1f4b645 (patch)
tree1d98dd3e41f9c3d4b80b910bfbaa29b68524668f /core/src/ch
parentc2126e98a99dd5aeddf45c02ef193d26279ddd7b (diff)
downloadRustAndDust-c95a74ec7b5954881bad3a1c6e0a4fa3a1f4b645.zip
RustAndDust-c95a74ec7b5954881bad3a1c6e0a4fa3a1f4b645.tar.gz
Battle: getFirstPlayer(), getSecondPlayer() -> getPlayer(boolean first, boolean deploymentPhase)
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/game/Battle.java4
-rw-r--r--core/src/ch/asynk/tankontank/game/Ctrl.java4
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/BattleCommon.java9
3 files changed, 5 insertions, 12 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Battle.java b/core/src/ch/asynk/tankontank/game/Battle.java
index 8bc1642..13e3162 100644
--- a/core/src/ch/asynk/tankontank/game/Battle.java
+++ b/core/src/ch/asynk/tankontank/game/Battle.java
@@ -11,9 +11,7 @@ public interface Battle
public String getDescription();
- public Player getFirstPlayer();
-
- public Player getSecondPlayer();
+ public Player getPlayer(boolean first, boolean deploymentPhase);
public Map getMap();
diff --git a/core/src/ch/asynk/tankontank/game/Ctrl.java b/core/src/ch/asynk/tankontank/game/Ctrl.java
index 6889342..f2d7283 100644
--- a/core/src/ch/asynk/tankontank/game/Ctrl.java
+++ b/core/src/ch/asynk/tankontank/game/Ctrl.java
@@ -53,8 +53,8 @@ public class Ctrl implements Disposable
this.cfg = game.config;
game.ctrl = this;
- this.player = battle.getFirstPlayer();
- this.opponent = battle.getSecondPlayer();
+ this.player = battle.getPlayer(true, false);
+ this.opponent = battle.getPlayer(false, false);
this.map = battle.getMap();
battle.setup(map, player, opponent);
diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java b/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java
index 4893411..49e9d8d 100644
--- a/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java
+++ b/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java
@@ -56,14 +56,9 @@ public abstract class BattleCommon implements Battle
}
}
- public Player getFirstPlayer()
+ public Player getPlayer(boolean first, boolean deploymentPhase)
{
- return factory.getPlayer(firstArmy);
- }
-
- public Player getSecondPlayer()
- {
- return factory.getPlayer(secondArmy);
+ return factory.getPlayer((first ? firstArmy : secondArmy));
}
public EntryPoint getEntryPoint(Unit unit)