summaryrefslogtreecommitdiffstats
path: root/core/src/ch
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2014-10-15 15:05:47 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2014-10-15 15:05:47 +0200
commitba559a8a0d13483e0b5a3f0751ca58fe78dfc356 (patch)
tree4395cfbba1670c535bc0fa8c702ef98bab8fd173 /core/src/ch
parent8e2b9dfb7046128ffda0d065f0beb75c3561afba (diff)
downloadRustAndDust-ba559a8a0d13483e0b5a3f0751ca58fe78dfc356.zip
RustAndDust-ba559a8a0d13483e0b5a3f0751ca58fe78dfc356.tar.gz
Board: add addAnimation(Animation) and int removePawn(Pawn)
Diffstat (limited to 'core/src/ch')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Board.java16
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();
}