summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-09 14:05:59 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-09 14:05:59 +0200
commit133b42d10fd28ece2f19f97735f52a82509332bc (patch)
tree4a5cf933d8de72bf39680f362828c63b6c92caa5 /core/src/ch/asynk
parenta275df92aab52735105561fcc930d3ffbc8b4f6b (diff)
downloadRustAndDust-133b42d10fd28ece2f19f97735f52a82509332bc.zip
RustAndDust-133b42d10fd28ece2f19f97735f52a82509332bc.tar.gz
Map: use getPathCost(Pawn, int), pawn.move(int) ,pawn.rotate()
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/game/Map.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/src/ch/asynk/tankontank/game/Map.java b/core/src/ch/asynk/tankontank/game/Map.java
index 351701f..4e7416d 100644
--- a/core/src/ch/asynk/tankontank/game/Map.java
+++ b/core/src/ch/asynk/tankontank/game/Map.java
@@ -172,8 +172,10 @@ public abstract class Map extends Board
public void movePawn(Pawn pawn, Orientation o)
{
+ 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() {
@Override
public void run() {
@@ -185,6 +187,7 @@ 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() {