diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-03 11:51:03 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-11-03 11:51:03 +0100 |
commit | 74c346057fd146f01b76688f6d97827801fcd5d8 (patch) | |
tree | 2fdcebac277b4f0f2a5083303dcd773a4118cf74 /core/src/ch/asynk/tankontank/game/battles | |
parent | b721725ce99f879681e5b98ceca42f59b0c90818 (diff) | |
download | RustAndDust-74c346057fd146f01b76688f6d97827801fcd5d8.zip RustAndDust-74c346057fd146f01b76688f6d97827801fcd5d8.tar.gz |
BattleCommon: add entryPoints=ArrayList<TileSet>, and pawnEntry=HashMap<Unit, TileSet>
Diffstat (limited to 'core/src/ch/asynk/tankontank/game/battles')
-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); + } } |