summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-10 17:33:47 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-10 17:33:47 +0100
commit9ca69a1f28066bfb71f30338d3ac74711b5242f7 (patch)
treec0fb1acac692c43472d28f6be644f4afe9572e17
parent782368421474ed28886ab9f5fec1d02d9bde6618 (diff)
downloadRustAndDust-9ca69a1f28066bfb71f30338d3ac74711b5242f7.zip
RustAndDust-9ca69a1f28066bfb71f30338d3ac74711b5242f7.tar.gz
Battle: add Position getHudPosition(Player player)
-rw-r--r--core/src/ch/asynk/tankontank/game/Battle.java3
-rw-r--r--core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java7
2 files changed, 10 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Battle.java b/core/src/ch/asynk/tankontank/game/Battle.java
index 5112355..4970df6 100644
--- a/core/src/ch/asynk/tankontank/game/Battle.java
+++ b/core/src/ch/asynk/tankontank/game/Battle.java
@@ -4,6 +4,7 @@ import ch.asynk.tankontank.engine.TileSet;
import ch.asynk.tankontank.engine.Orientation;
import ch.asynk.tankontank.game.Unit;
import ch.asynk.tankontank.game.Player;
+import ch.asynk.tankontank.game.hud.Position;
public interface Battle
{
@@ -24,4 +25,6 @@ public interface Battle
public TileSet getEntryPoint(Unit unit);
public Orientation getEntryOrientation(Player player);
+
+ public Position getHudPosition(Player player);
}
diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java b/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java
index 167c53a..0cc046a 100644
--- a/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java
+++ b/core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java
@@ -11,6 +11,7 @@ import ch.asynk.tankontank.game.Army;
import ch.asynk.tankontank.game.Player;
import ch.asynk.tankontank.game.Unit;
import ch.asynk.tankontank.game.Unit.UnitId;
+import ch.asynk.tankontank.game.hud.Position;
import ch.asynk.tankontank.engine.Tile;
import ch.asynk.tankontank.engine.TileSet;
import ch.asynk.tankontank.engine.Orientation;
@@ -53,6 +54,12 @@ public class BattleHeadToHead extends BattleCommon
}
@Override
+ public Position getHudPosition(Player player)
+ {
+ return (player.isEnemy(Army.GE) ? Position.TOP_RIGHT: Position.TOP_LEFT);
+ }
+
+ @Override
public Map getMap()
{
return factory.getMap(Factory.MapType.MAP_A);