diff options
3 files changed, 10 insertions, 5 deletions
diff --git a/core/src/ch/asynk/rustanddust/game/Battle.java b/core/src/ch/asynk/rustanddust/game/Battle.java index 86d95a7..c54f9f4 100644 --- a/core/src/ch/asynk/rustanddust/game/Battle.java +++ b/core/src/ch/asynk/rustanddust/game/Battle.java @@ -21,8 +21,6 @@ public interface Battle public void start(); - public Player getVictor(); - public boolean actionDone(); public boolean turnDone(); diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java index 0cc2189..e84961f 100644 --- a/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java +++ b/core/src/ch/asynk/rustanddust/game/battles/BattleCommon.java @@ -31,6 +31,8 @@ public abstract class BattleCommon implements Battle protected HashMap<Unit, Zone> unitEntry = new HashMap<Unit, Zone>(); protected HashMap<Unit, Zone> unitExit = new HashMap<Unit, Zone>(); + public abstract Player getWinner(); + public BattleCommon(Factory factory) { this.factory = factory; @@ -85,17 +87,22 @@ public abstract class BattleCommon implements Battle { map.turnDone(); currentPlayer.turnEnd(); - Player winner = getVictor(); + Player winner = getWinner(); if (winner != null) { currentPlayer = winner; return true; } else { - currentPlayer = getOpponent(); + currentPlayer = getNextPlayer(); currentPlayer.turnStart(); return false; } } + public Player getNextPlayer() + { + return getOpponent(); + } + @Override public Player getPlayer() { diff --git a/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java b/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java index f161a36..fc6f453 100644 --- a/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java +++ b/core/src/ch/asynk/rustanddust/game/battles/BattleTest.java @@ -37,7 +37,7 @@ public class BattleTest extends BattleCommon } @Override - public Player getVictor() + public Player getWinner() { if (usPlayer.getTurnDone() > 2) return usPlayer; |