From 4c6e80e4ee0cbc669a7fc160d19fa1eb8babd3fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 28 Oct 2014 16:38:55 +0100 Subject: Tile: create stack at Tile construction --- core/src/ch/asynk/tankontank/engine/Tile.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/core/src/ch/asynk/tankontank/engine/Tile.java b/core/src/ch/asynk/tankontank/engine/Tile.java index 0514c6d..1c767fe 100644 --- a/core/src/ch/asynk/tankontank/engine/Tile.java +++ b/core/src/ch/asynk/tankontank/engine/Tile.java @@ -37,7 +37,7 @@ public abstract class Tile implements Drawable, Disposable public Tile(float x, float y, int col, int row, TextureAtlas atlas) { - this.stack = null; + this.stack = new ArrayDeque(); this.x = x; this.y = y; this.col = col; @@ -54,13 +54,12 @@ public abstract class Tile implements Drawable, Disposable @Override public void dispose() { - if(stack != null) stack.clear(); + stack.clear(); overlays.dispose(); } public boolean isEmpty() { - if (stack == null) return true; return stack.isEmpty(); } @@ -71,7 +70,6 @@ public abstract class Tile implements Drawable, Disposable public int push(Pawn pawn) { - if (stack == null) stack = new ArrayDeque(); stack.push(pawn); return stack.size(); } -- cgit v1.1-2-g2b99