summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-10 09:03:13 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-10 09:03:13 +0200
commit1cd3ab201454b5e09b7268da55f54c604e5444cd (patch)
tree87438f4bc7afd2cb995ee3b134297390e4c06d87 /core/src/ch/asynk/tankontank
parent47852fa8e4194ab363f535e73d84a12f4e5f33e5 (diff)
downloadRustAndDust-1cd3ab201454b5e09b7268da55f54c604e5444cd.zip
RustAndDust-1cd3ab201454b5e09b7268da55f54c604e5444cd.tar.gz
Map: update rotate and move according to the previous modifications
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 4e7416d..0167203 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -175,8 +175,19 @@ public abstract class Map extends Board
int cost = getPathCost(pawn, 0);
int s = getCoordinatePath(pawn, 0, finalPath, o);
if (s > 0) {
- ((Unit) pawn).move(cost);
- movePawn(pawn, finalPath, RunnableAnimation.get(pawn, new Runnable() {
+ movePawn(pawn, cost, finalPath, RunnableAnimation.get(pawn, new Runnable() {
+ @Override
+ public void run() {
+ ctrl.animationDone();
+ }
+ }));
+ }
+ }
+
+ public void revertMoves()
+ {
+ for (Pawn pawn : activatedPawns) {
+ revertLastPawnMove(pawn, RunnableAnimation.get(pawn, new Runnable() {
@Override
public void run() {
ctrl.animationDone();
@@ -187,7 +198,6 @@ public abstract class Map extends Board
public void rotatePawn(Pawn pawn, Orientation o)
{
- ((Unit) pawn).rotate();
rotatePawn(pawn, o, RunnableAnimation.get(pawn, new Runnable() {
@Override
public void run() {