diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-08 14:57:54 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-01-08 15:07:29 +0100 |
commit | 5f01696620bb8a4448799856d4a9290bec77b3f6 (patch) | |
tree | 7cb023598638b40463b01ac4274958294d4333c9 /core | |
parent | f0712396215539d9863af16332a8e7774b3a95a1 (diff) | |
download | RustAndDust-5f01696620bb8a4448799856d4a9290bec77b3f6.zip RustAndDust-5f01696620bb8a4448799856d4a9290bec77b3f6.tar.gz |
Board: each constructor must initialise sides[] array
Diffstat (limited to 'core')
-rw-r--r-- | core/src/ch/asynk/tankontank/engine/Board.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/src/ch/asynk/tankontank/engine/Board.java b/core/src/ch/asynk/tankontank/engine/Board.java index 6aa6ea7..865adf8 100644 --- a/core/src/ch/asynk/tankontank/engine/Board.java +++ b/core/src/ch/asynk/tankontank/engine/Board.java @@ -71,6 +71,7 @@ public abstract class Board implements Disposable, Animation this.cols = (cols + 2); this.rows = (rows + 2); searchBoard = new SearchBoard(this, cols, rows); + initSides(); } public Board(TileBuilder tileBuilder, Config cfg, Texture boardTexture, SelectedTile selectedTile) @@ -99,6 +100,14 @@ public abstract class Board implements Disposable, Animation evenRow = !evenRow; } + initSides(); + + this.selectedTile = selectedTile; + animations.add(selectedTile); + } + + private void initSides() + { this.sides = new Orientation[6]; sides[0] = Orientation.NORTH; sides[1] = Orientation.NORTH_EAST; @@ -106,9 +115,6 @@ public abstract class Board implements Disposable, Animation sides[3] = Orientation.SOUTH; sides[4] = Orientation.SOUTH_WEST; sides[5] = Orientation.NORTH_WEST; - - this.selectedTile = selectedTile; - animations.add(selectedTile); } @Override |