diff options
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 13 | ||||
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Tile.java | 4 |
2 files changed, 16 insertions, 1 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index 16a27d2..05f90f2 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -136,6 +136,19 @@ public abstract class Board extends Image implements Disposable debugShapes.setTransformMatrix(prevTransform); } + public void enableOverlayOn(int col, int row, int i, boolean enable) + { + enableOverlayOn(board[row][col], i, enable); + } + + public void enableOverlayOn(Tile tile, int i, boolean enable) + { + if(tile.enableOverlay(i, enable)) + tilesToDraw.add(tile); + else + tilesToDraw.remove(tile); + } + public Pawn getTopPawnAt(GridPoint2 cell) { return getTopPawnAt(cell.x, cell.y); diff --git a/core/src/ch/asynk/tankontank/engine/Tile.java b/core/src/ch/asynk/tankontank/engine/Tile.java index f7122fe..94f3435 100644 --- a/core/src/ch/asynk/tankontank/engine/Tile.java +++ b/core/src/ch/asynk/tankontank/engine/Tile.java @@ -69,9 +69,11 @@ public abstract class Tile implements BasicDrawable return overlays.isEnabled(); } - public void enableOverlay(int i, boolean enable) + public boolean enableOverlay(int i, boolean enable) { overlays.enable(i, enable); + if (enable) return true; + return mustBeDrawn(); } public List<Tile> adjacents() |