diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-15 15:05:47 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2014-10-15 15:05:47 +0200 |
commit | ba559a8a0d13483e0b5a3f0751ca58fe78dfc356 (patch) | |
tree | 4395cfbba1670c535bc0fa8c702ef98bab8fd173 /core | |
parent | 8e2b9dfb7046128ffda0d065f0beb75c3561afba (diff) | |
download | RustAndDust-ba559a8a0d13483e0b5a3f0751ca58fe78dfc356.zip RustAndDust-ba559a8a0d13483e0b5a3f0751ca58fe78dfc356.tar.gz |
Board: add addAnimation(Animation) and int removePawn(Pawn)
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 16 |
1 files 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(); } |