From fd4f171c54636226a43eaacdb2082ff603dd5a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 3 Oct 2014 17:07:30 +0200 Subject: Board: use pawn.getPosAt(center, pos) --- core/src/ch/asynk/tankontank/engine/Board.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index b124389..c98682d 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -441,13 +441,7 @@ public abstract class Board implements Disposable public Vector2 getPawnPosAt(Pawn pawn, GridPoint2 coords, Vector2 pos) { Vector2 center = getTile(coords).getCenter(); - float x = (center.x - (pawn.getWidth() / 2)); - float y = (center.y - (pawn.getHeight() / 2)); - if (pos == null) - return new Vector2(x, y); - else - pos.set(x, y); - return pos; + return pawn.getPosAt(center, pos); } public void setPawnAt(Pawn pawn, GridPoint2 coords, Orientation o) @@ -481,7 +475,7 @@ public abstract class Board implements Disposable seq.addAnimation(RunnableAnimation.get(pawn, new Runnable() { @Override public void run() { - pushPawnAt(pawn, new GridPoint2(getHexAt(finalPos))); + pushPawnAt(pawn, getHexAt(finalPos)); } })); addPawnAnimation(pawn, seq); -- cgit v1.1-2-g2b99