From 9ca69a1f28066bfb71f30338d3ac74711b5242f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 10 Nov 2014 17:33:47 +0100 Subject: Battle: add Position getHudPosition(Player player) --- core/src/ch/asynk/tankontank/game/Battle.java | 3 +++ core/src/ch/asynk/tankontank/game/battles/BattleHeadToHead.java | 7 +++++++ 2 files changed, 10 insertions(+) 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); -- cgit v1.1-2-g2b99