summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-12-08 21:38:39 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-12-08 21:38:39 +0100
commit77af3c2932a9a246e3ef10296cd62848f07d84f7 (patch)
tree11a02ae04465e8e585e9a35da868649d769b7ec0 /core/src/ch
parent126f37e29f279e8ce854e29a4d0313004e58993c (diff)
downloadRustAndDust-77af3c2932a9a246e3ef10296cd62848f07d84f7.zip
RustAndDust-77af3c2932a9a246e3ef10296cd62848f07d84f7.tar.gz
Battle: no need of Player parameter anymore
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/rustanddust/game/Battle.java6
-rw-r--r--core/src/ch/asynk/rustanddust/game/Ctrl.java8
-rw-r--r--core/src/ch/asynk/rustanddust/game/Hud.java2
-rw-r--r--core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java8
-rw-r--r--core/src/ch/asynk/rustanddust/game/battles/BattleTest.java4
5 files changed, 14 insertions, 14 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Battle.java b/core/src/ch/asynk/rustanddust/game/Battle.java
index fd384df..5e4a76d 100644
--- a/core/src/ch/asynk/rustanddust/game/Battle.java
+++ b/core/src/ch/asynk/rustanddust/game/Battle.java
@@ -32,11 +32,11 @@ public interface Battle
public Zone getExitZone(Unit unit);
- public Position getHudPosition(Player player);
+ public Position getHudPosition();
- public State.StateType getState(Player player);
+ public State.StateType getState();
- public boolean deploymentDone(Player player);
+ public boolean deploymentDone();
public void setup(Ctrl ctrl, Map map);
}
diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java
index ab1293a..dd45423 100644
--- a/core/src/ch/asynk/rustanddust/game/Ctrl.java
+++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java
@@ -119,7 +119,7 @@ public class Ctrl implements Disposable
if (battle.getReinforcement(this, map))
hud.notify("You have reinforcement", 2, Position.MIDDLE_CENTER, true);
hud.update();
- setState(battle.getState(battle.getPlayer()));
+ setState(battle.getState());
}
private void endPlayerTurn()
@@ -136,7 +136,7 @@ public class Ctrl implements Disposable
StateType nextState = this.state.abort();
if (nextState == StateType.ABORT)
- nextState = battle.getState(battle.getPlayer());
+ nextState = battle.getState();
return nextState;
}
@@ -166,7 +166,7 @@ public class Ctrl implements Disposable
}
if (nextState == StateType.DONE)
- nextState = battle.getState(battle.getPlayer());
+ nextState = battle.getState();
return nextState;
}
@@ -284,7 +284,7 @@ public class Ctrl implements Disposable
public boolean checkDeploymentDone()
{
- boolean done = battle.deploymentDone(battle.getPlayer());
+ boolean done = battle.deploymentDone();
if (done)
hud.askEndDeployment();
return done;
diff --git a/core/src/ch/asynk/rustanddust/game/Hud.java b/core/src/ch/asynk/rustanddust/game/Hud.java
index 779c4f9..3c1805f 100644
--- a/core/src/ch/asynk/rustanddust/game/Hud.java
+++ b/core/src/ch/asynk/rustanddust/game/Hud.java
@@ -91,7 +91,7 @@ public class Hud implements Disposable, Animation
public void update()
{
- Position position = ctrl.battle.getHudPosition(ctrl.battle.getPlayer());
+ Position position = ctrl.battle.getHudPosition();
playerInfo.update(ctrl.battle.getPlayer(), position);
actionButtons.update(position.horizontalMirror());
}
diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
index 112deaf..4585fdd 100644
--- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
+++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java
@@ -93,15 +93,15 @@ public abstract class BattleCommon implements Battle
}
@Override
- public boolean deploymentDone(Player player)
+ public boolean deploymentDone()
{
- return player.isDeploymentDone();
+ return currentPlayer.isDeploymentDone();
}
@Override
- public StateType getState(Player player)
+ public StateType getState()
{
- if (!player.isDeploymentDone())
+ if (!currentPlayer.isDeploymentDone())
return StateType.DEPLOYMENT;
return StateType.SELECT;
}
diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java b/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java
index 348e20a..df3ff2a 100644
--- a/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java
+++ b/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java
@@ -24,9 +24,9 @@ public class BattleTest extends BattleCommon
}
@Override
- public Position getHudPosition(Player player)
+ public Position getHudPosition()
{
- return (player.is(Army.US) ? Position.TOP_RIGHT: Position.TOP_LEFT);
+ return (currentPlayer.is(Army.US) ? Position.TOP_RIGHT: Position.TOP_LEFT);
}
@Override