diff options
Diffstat (limited to 'core/src/ch/asynk/tankontank/engine')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index e8c56d7..3115c40 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -70,7 +70,7 @@ public abstract class Board extends Image implements Disposable private final Vector<Animation> animations = new Vector<Animation>(2); private final Vector<Animation> nextAnimations = new Vector<Animation>(2); private final LinkedHashSet<Tile> tilesToDraw = new LinkedHashSet<Tile>(); - private final LinkedHashSet<Pawn> pawnsToDraw = new LinkedHashSet<Pawn>(); + protected final LinkedHashSet<Pawn> pawnsToDraw = new LinkedHashSet<Pawn>(); public Board(Config cfg, Tile[][] board, Texture texture) { @@ -194,6 +194,19 @@ public abstract class Board extends Image implements Disposable tilesToDraw.remove(tile); } + public Pawn removeTopPawnFrom(GridPoint2 tile) + { + return removeTopPawnFrom(tile.x, tile.y); + } + + public Pawn removeTopPawnFrom(int col, int row) + { + Pawn pawn = getTopPawnAt(col, row); + if (pawn != null) + removePawnFrom(pawn, col, row); + return pawn; + } + public Pawn getTopPawnAt(GridPoint2 tile) { return getTopPawnAt(tile.x, tile.y); |