summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-11-18 16:27:57 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2014-11-18 16:27:57 +0100
commit3a0d535e8c885064a2c2f8e5dff1d36ebd35cc08 (patch)
tree38e6c7df492a79826f63a43f27bbc5cb0d655a31 /core
parentba7371fa91a3af11d36f7f332e0823691a311414 (diff)
downloadRustAndDust-3a0d535e8c885064a2c2f8e5dff1d36ebd35cc08.zip
RustAndDust-3a0d535e8c885064a2c2f8e5dff1d36ebd35cc08.tar.gz
Map,StatePromote: state does everything, TODO burn 1 AP down
Diffstat (limited to 'core')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java7
-rw-r--r--core/src/ch/asynk/tankontank/game/states/StatePromote.java4
2 files changed, 3 insertions, 8 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 970e750..7682893 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -196,13 +196,6 @@ public abstract class Map extends Board
pawn.reset();
}
- public void promote(Pawn pawn, Pawn with)
- {
- removePawn(pawn);
- setPawnOnto(with, pawn.getTile(), pawn.getOrientation());
- activatedPawns.add(with);
- }
-
public int movePawn(Pawn pawn, Orientation o)
{
possiblePaths.orientation = o;
diff --git a/core/src/ch/asynk/tankontank/game/states/StatePromote.java b/core/src/ch/asynk/tankontank/game/states/StatePromote.java
index 70cb875..cf628d9 100644
--- a/core/src/ch/asynk/tankontank/game/states/StatePromote.java
+++ b/core/src/ch/asynk/tankontank/game/states/StatePromote.java
@@ -10,8 +10,10 @@ public class StatePromote extends StateCommon
ctrl.hud.actionButtons.hide();
Unit unit = ctrl.player.promote(selectedUnit);
if (unit != null) {
+ // TODO this must burn 1 AP down !!!!!
ctrl.hud.notify(unit + " has been promoted");
- map.promote(selectedUnit, unit);
+ selectedUnit.promote();
+ unit.degrade();
}
done();
}