From 2ec8db85412449125fb4918c80dcc71872a923bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 10 Oct 2014 11:57:10 +0200 Subject: Board: code reordering --- core/src/ch/asynk/tankontank/engine/Board.java | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index f6d28bb..f40a6b8 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -519,6 +519,18 @@ public abstract class Board implements Disposable pawn.move(cost); } + protected 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); + pawn.rotate(o); + } + protected void revertLastPawnMove(final Pawn pawn, RunnableAnimation whenDone) { removePawnFrom(pawn, getHexAt(pawn.getCenter())); @@ -535,18 +547,6 @@ public abstract class Board implements Disposable pawn.revertLastMove(); } - protected 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); - pawn.rotate(o); - } - public GridPoint2 getHexAt(Vector2 v) { if (v == null) return null; -- cgit v1.1-2-g2b99