diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-03 17:07:30 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-03 17:07:30 +0200 |
commit | fd4f171c54636226a43eaacdb2082ff603dd5a74 (patch) | |
tree | faee8628f5c15515359bf7162f134e0d7be2a528 /core/src | |
parent | 1f704fcf75b9b9341eb4f12e7432fd95b8b554ab (diff) | |
download | RustAndDust-fd4f171c54636226a43eaacdb2082ff603dd5a74.zip RustAndDust-fd4f171c54636226a43eaacdb2082ff603dd5a74.tar.gz |
Board: use pawn.getPosAt(center, pos)
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 10 |
1 files 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); |