From ba559a8a0d13483e0b5a3f0751ca58fe78dfc356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Wed, 15 Oct 2014 15:05:47 +0200 Subject: Board: add addAnimation(Animation) and int removePawn(Pawn) --- core/src/ch/asynk/tankontank/engine/Board.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index 7fc9d8d..94cb083 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -195,6 +195,11 @@ public abstract class Board implements Disposable neighbours[5].set((coords.x - 1), (coords.y - 1)); } + public void addAnimation(Animation a) + { + nextAnimations.add(a); + } + private void stats() { boolean print = false; @@ -524,6 +529,11 @@ public abstract class Board implements Disposable return tile.push(pawn); } + public int removePawn(Pawn pawn) + { + return removePawnFrom(pawn, getHexUnder(pawn)); + } + public int removePawnFrom(Pawn pawn, GridPoint2 coords) { Tile tile = getTile(coords); @@ -559,7 +569,7 @@ public abstract class Board implements Disposable } })); seq.addAnimation(whenDone); - nextAnimations.add(seq); + addAnimation(seq); pawn.move(cost); } @@ -570,7 +580,7 @@ public abstract class Board implements Disposable v.set(p.x, p.y, o.r()); AnimationSequence seq = pawn.getRotateAnimation(v); seq.addAnimation(whenDone); - nextAnimations.add(seq); + addAnimation(seq); vector3Pool.free(v); pawn.rotate(o); } @@ -587,7 +597,7 @@ public abstract class Board implements Disposable } })); seq.addAnimation(whenDone); - nextAnimations.add(seq); + addAnimation(seq); pawn.revertLastMove(); } -- cgit v1.1-2-g2b99