From bd9947b9147e0aa3a9d2af7220a759e53fa006bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 6 Oct 2014 14:15:01 +0200 Subject: Board: add rotatePawn(Pawn, Orientation, RunnableAnnimation) --- core/src/ch/asynk/tankontank/engine/Board.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index ee0c76e..5b5ecf8 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -452,6 +452,17 @@ public abstract class Board implements Disposable addPawnAnimation(pawn, seq); } + public void rotatePawn(final Pawn pawn, Orientation o, RunnableAnimation whenDone) + { + Vector3 p = pawn.getPosition(); + Vector3 v = vector3Pool.obtain(); + v.set(p.x, p.y, o.r()); + AnimationSequence seq = pawn.getRotateAnimation(v); + seq.addAnimation(whenDone); + addPawnAnimation(pawn, seq); + vector3Pool.free(v); + } + private GridPoint2 getHexAt(Vector2 v) { if (v == null) return null; -- cgit v1.1-2-g2b99