diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-16 21:52:34 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-09-16 21:52:34 +0200 |
commit | 72b62231b61a6887a74230655ea194afba9d0704 (patch) | |
tree | 8ba00f2a5ca8af0cd148c4d916456d5e7aabd210 /core/src/ch/asynk/tankontank/game | |
parent | 157656391964c41465bb0380a096cea5d8d72172 (diff) | |
download | RustAndDust-72b62231b61a6887a74230655ea194afba9d0704.zip RustAndDust-72b62231b61a6887a74230655ea194afba9d0704.tar.gz |
add Pawn#setPawnAt
Diffstat (limited to 'core/src/ch/asynk/tankontank/game')
-rw-r--r-- | core/src/ch/asynk/tankontank/game/HexMap.java | 2 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/game/HexMapImage.java | 7 |
2 files changed, 9 insertions, 0 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()); |