diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2016-03-31 11:46:05 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2016-03-31 11:46:05 +0200 |
commit | 418f4435ba6fdb6ed382c87076216a5f34591ff1 (patch) | |
tree | 217f318938f2145f8c22dc301e0713f03f0106ad /core | |
parent | f43bdee9d438e4b4dc85fe5c5a767bfd0c885849 (diff) | |
download | RustAndDust-418f4435ba6fdb6ed382c87076216a5f34591ff1.zip RustAndDust-418f4435ba6fdb6ed382c87076216a5f34591ff1.tar.gz |
Battle: hasReinforcement() -> setNextTurn()
Diffstat (limited to 'core')
5 files changed, 12 insertions, 26 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Battle.java b/core/src/ch/asynk/rustanddust/game/Battle.java index f2d874b..168f5ee 100644 --- a/core/src/ch/asynk/rustanddust/game/Battle.java +++ b/core/src/ch/asynk/rustanddust/game/Battle.java @@ -36,7 +36,5 @@ public interface Battle extends Marshal public boolean isDeploymentDone(); - public boolean hasReinforcement(); - public State.StateType getState(); } diff --git a/core/src/ch/asynk/rustanddust/game/Ctrl.java b/core/src/ch/asynk/rustanddust/game/Ctrl.java index 6b5ec1a..93e473a 100644 --- a/core/src/ch/asynk/rustanddust/game/Ctrl.java +++ b/core/src/ch/asynk/rustanddust/game/Ctrl.java @@ -328,7 +328,7 @@ public abstract class Ctrl implements Disposable if (battle.turnDone()) hud.victory(battle.getPlayer(), battle.getOpponent()); else { - if (battle.hasReinforcement()) + if (battle.getPlayer().hasReinforcement()) hud.notify("You have reinforcement", 2, Position.MIDDLE_CENTER, true); hud.update(); if (!battle.getPlayer().canDoSomething()) { diff --git a/core/src/ch/asynk/rustanddust/game/battles/Battle00.java b/core/src/ch/asynk/rustanddust/game/battles/Battle00.java index 949ca04..ba61483 100644 --- a/core/src/ch/asynk/rustanddust/game/battles/Battle00.java +++ b/core/src/ch/asynk/rustanddust/game/battles/Battle00.java @@ -37,10 +37,7 @@ public class Battle00 extends BattleCommon } @Override - public boolean hasReinforcement() - { - return false; - } + public void setNextTurn() { } // SETUP diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java index eef5cc7..975cc46 100644 --- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java +++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java @@ -36,6 +36,7 @@ public abstract class BattleCommon implements Battle protected abstract Player getWinner(); protected abstract void setup(); protected abstract void deployPlayer(); + protected abstract void setNextTurn(); private int d6() { @@ -149,6 +150,7 @@ public abstract class BattleCommon implements Battle currentPlayer.turnStart(getActionPoints()); } turnCount += 1; + setNextTurn(); map.turnDone(); return ret; } @@ -210,12 +212,6 @@ public abstract class BattleCommon implements Battle } @Override - public boolean hasReinforcement() - { - return false; - } - - @Override public StateType getState() { if (!currentPlayer.isDeploymentDone()) diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java b/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java index d66dae6..86d4c32 100644 --- a/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java +++ b/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java @@ -34,20 +34,15 @@ public class BattleTest extends BattleCommon } @Override - public boolean hasReinforcement() + public void setNextTurn() { - if (currentPlayer.is(Army.GE)) - return false; - if (currentPlayer.getTurn() != 2) - return false; - - Zone usEntry = new Zone(map, 1); - usEntry.allowedMoves = (Orientation.SOUTH.s | Orientation.SOUTH_EAST.s | Orientation.SOUTH_WEST.s); - usEntry.add(map.getHex(12, 6)); - addEntryZone(usEntry); - addReinforcement(currentPlayer, usEntry, usExit, UnitCode.US_WOLVERINE); - - return true; + if (turnCount == 3) { + Zone usEntry = new Zone(map, 1); + usEntry.allowedMoves = (Orientation.SOUTH.s | Orientation.SOUTH_EAST.s | Orientation.SOUTH_WEST.s); + usEntry.add(map.getHex(12, 6)); + addEntryZone(usEntry); + addReinforcement(currentPlayer, usEntry, usExit, UnitCode.US_WOLVERINE); + } } // SETUP |