diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/battles/BattleCommon.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java b/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java index ed7a82c..f6795b0 100644 --- a/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java +++ b/core/src/ch/asynk/tankontank/game/battles/BattleCommon.java @@ -1,9 +1,15 @@ package ch.asynk.tankontank.game.battles; import java.util.Random; +import java.util.HashMap; +import java.util.ArrayList; +import ch.asynk.tankontank.engine.TileSet; import ch.asynk.tankontank.game.Army; import ch.asynk.tankontank.game.Battle; +import ch.asynk.tankontank.game.Player; +import ch.asynk.tankontank.game.Unit; +import ch.asynk.tankontank.game.Unit.UnitId; public abstract class BattleCommon implements Battle { @@ -14,6 +20,8 @@ public abstract class BattleCommon implements Battle protected Army firstArmy; protected Army secondArmy; protected Factory factory; + protected ArrayList<TileSet> entryPoints = new ArrayList<TileSet>(); + protected HashMap<Unit, TileSet> pawnEntry = new HashMap<Unit, TileSet>(); public BattleCommon(Factory factory) { @@ -40,4 +48,16 @@ public abstract class BattleCommon implements Battle secondArmy = Army.US; } } + + public void addEntryPoint(TileSet tiles) + { + entryPoints.add(tiles); + } + + public void addReinforcement(Player player, TileSet entryPoint, UnitId unitId) + { + Unit unit = factory.getUnit(unitId); + player.addReinforcement(unit); + pawnEntry.put(unit, entryPoint); + } } |