summaryrefslogtreecommitdiffstats
path: root/core/src/ch/asynk/tankontank
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2015-01-08 14:57:54 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2015-01-08 15:07:29 +0100
commit5f01696620bb8a4448799856d4a9290bec77b3f6 (patch)
tree7cb023598638b40463b01ac4274958294d4333c9 /core/src/ch/asynk/tankontank
parentf0712396215539d9863af16332a8e7774b3a95a1 (diff)
downloadRustAndDust-5f01696620bb8a4448799856d4a9290bec77b3f6.zip
RustAndDust-5f01696620bb8a4448799856d4a9290bec77b3f6.tar.gz
Board: each constructor must initialise sides[] array
Diffstat (limited to 'core/src/ch/asynk/tankontank')
-rw-r--r--core/src/ch/asynk/tankontank/engine/Board.java12
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