summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-05 12:21:15 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-05 12:21:15 +0100
commitcf2b8d408b1bbe51a7aa8e3b93bde8f3b4af78c0 (patch)
tree068098ff82123fe408bdb61af51675e00de48156 /core
parent0857206ad6691a4fd46a67d110e511dad141d642 (diff)
downloadRustAndDust-cf2b8d408b1bbe51a7aa8e3b93bde8f3b4af78c0.zip
RustAndDust-cf2b8d408b1bbe51a7aa8e3b93bde8f3b4af78c0.tar.gz
Battle: add TileSet getEntryPoint(Unit) Orientation getEntryOrientation(Player)
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/Battle.java9
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/BattleCommon.java5
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java8
3 files changed, 22 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Battle.java b/core/src/ch/asynk/tankontank/game/Battle.java
index e59db41..ec60ffc 100644
--- a/core/src/ch/asynk/tankontank/game/Battle.java
+++ b/core/src/ch/asynk/tankontank/game/Battle.java
@@ -1,5 +1,10 @@
package ch.asynk.tankontank.game;
+import ch.asynk.tankontank.engine.TileSet;
+import ch.asynk.tankontank.engine.Orientation;
+import ch.asynk.tankontank.game.Unit;
+import ch.asynk.tankontank.game.Player;
+
public interface Battle
{
public String getName();
@@ -15,4 +20,8 @@ public interface Battle
public void setup(Map map, Player firstPlayer, Player secondPlayer);
public boolean checkVictory(Ctrl ctrl);
+
+ public TileSet getEntryPoint(Unit unit);
+
+ public Orientation getEntryOrientation(Player player);
}
diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java b/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java
index f6795b0..e22d388 100644
--- a/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java
+++ b/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java
@@ -60,4 +60,9 @@ public abstract class BattleCommon implements Battle
player.addReinforcement(unit);
pawnEntry.put(unit, entryPoint);
}
+
+ public TileSet getEntryPoint(Unit unit)
+ {
+ return pawnEntry.get(unit);
+ }
}
diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java b/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java
index be17509..28fa7dc 100644
--- a/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java
+++ b/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java
@@ -64,6 +64,14 @@ public class BattleHeadToHead extends BattleCommon
}
@Override
+ public Orientation getEntryOrientation(Player player)
+ {
+ if (player.isEnemy(Army.GE))
+ return Orientation.SOUTH;
+ return Orientation.NORTH;
+ }
+
+ @Override
public void setup(Map map, Player a, Player b)
{
Player gePlayer;