From c95a74ec7b5954881bad3a1c6e0a4fa3a1f4b645 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 16 Nov 2014 13:22:23 +0100 Subject: Battle: getFirstPlayer(), getSecondPlayer() -> getPlayer(boolean first, boolean deploymentPhase) --- core/src/ch/asynk/tankontank/game/Battle.java | 4 +--- core/src/ch/asynk/tankontank/game/Ctrl.java | 4 ++-- core/src/ch/asynk/tankontank/game/battles/BattleCommon.java | 9 ++------- 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) -- cgit v1.1-2-g2b99