summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r--core/src/ch/asynk/tankontank/game/HexMap.java2
-rw-r--r--core/src/ch/asynk/tankontank/game/HexMapImage.java7
-rw-r--r--core/src/ch/asynk/tankontank/screens/GameScreen.java2
3 files changed, 10 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/game/HexMap.java b/core/src/ch/asynk/tankontank/game/HexMap.java
index faf9881..51c0ebb 100644
--- a/core/src/ch/asynk/tankontank/game/HexMap.java
+++ b/core/src/ch/asynk/tankontank/game/HexMap.java
@@ -23,6 +23,8 @@ public interface HexMap
public void movePawnTo(Pawn pawn, Vector3 coords);
+ public void setPawnAt(Pawn pawn, int col, int row, HexOrientation o);
+
public void movePawnTo(Pawn pawn, int col, int row, HexOrientation o);
}
diff --git a/core/src/ch/asynk/tankontank/game/HexMapImage.java b/core/src/ch/asynk/tankontank/game/HexMapImage.java
index c78fd55..0916808 100644
--- a/core/src/ch/asynk/tankontank/game/HexMapImage.java
+++ b/core/src/ch/asynk/tankontank/game/HexMapImage.java
@@ -98,6 +98,13 @@ public class HexMapImage extends Image implements HexMap
movePawnTo(pawn, p.x, p.y, HexOrientation.KEEP);
}
+ public void setPawnAt(final Pawn pawn, final int col, final int row, HexOrientation o)
+ {
+ int z = pushPawnAt(pawn, col, row);
+ Vector2 pos = getPawnPosAt(pawn, col, row);
+ pawn.pushMove(pos.x, pos.y, z, o);
+ }
+
public void movePawnTo(final Pawn pawn, final int col, final int row, HexOrientation o)
{
GridPoint2 prev = getHexAt(pawn.getLastPosition());
diff --git a/core/src/ch/asynk/tankontank/screens/GameScreen.java b/core/src/ch/asynk/tankontank/screens/GameScreen.java
index 0c4ebff..d7e2e4a 100644
--- a/core/src/ch/asynk/tankontank/screens/GameScreen.java
+++ b/core/src/ch/asynk/tankontank/screens/GameScreen.java
@@ -107,7 +107,7 @@ public class GameScreen extends AbstractScreen
private void addUnit(Stage stage, UnitType t, int col, int row, HexOrientation o)
{
Unit u = UnitFactory.getUnit(t);
- map.movePawnTo((Pawn) u, col, row, o);
+ map.setPawnAt((Pawn) u, col, row, o);
stage.addActor(u);
}