diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-21 19:26:18 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2015-12-21 19:26:18 +0100 |
commit | bccade845e568c5fd893e7567efb17d0bb7e8ea7 (patch) | |
tree | b40e8d990cf74678c245db42ab71b39f29467902 | |
parent | e5ecee141a00ce6fac02b134634d821a4daf44e3 (diff) | |
download | RustAndDust-bccade845e568c5fd893e7567efb17d0bb7e8ea7.zip RustAndDust-bccade845e568c5fd893e7567efb17d0bb7e8ea7.tar.gz |
Board: sprinkle with some final
-rw-r--r-- | core/src/ch/asynk/rustanddust/engine/Board.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/core/src/ch/asynk/rustanddust/engine/Board.java b/core/src/ch/asynk/rustanddust/engine/Board.java index d5e7b62..ba9e1a1 100644 --- a/core/src/ch/asynk/rustanddust/engine/Board.java +++ b/core/src/ch/asynk/rustanddust/engine/Board.java @@ -47,10 +47,10 @@ public abstract class Board implements Disposable, Animation } private Config cfg; - private Tile[] tiles; - private SearchBoard searchBoard; - private Sprite board; - private Orientation sides[]; + private final Tile[] tiles; + private final SearchBoard searchBoard; + private final Sprite board; + private final Orientation sides[]; private boolean transform; private Matrix4 prevTransform; @@ -72,19 +72,23 @@ public abstract class Board implements Disposable, Animation // add a frame of OFFMAP Tiles this.cols = (cols + 2); this.rows = (rows + 2); - searchBoard = new SearchBoard(this, cols, rows); + this.searchBoard = new SearchBoard(this, cols, rows); + this.sides = new Orientation[6]; initSides(); + this.tiles = null; + this.board = null; } public Board(TileBuilder tileBuilder, Texture boardTexture, SelectedTile selectedTile) { - board = new Sprite(boardTexture); this.cfg = getConfig(); // add a frame of OFFMAP Tiles this.cols = (cfg.cols + 2); this.rows = (cfg.rows + 2); + this.sides = new Orientation[6]; + this.board = new Sprite(boardTexture); this.tiles = new Tile[this.cols * this.rows]; - searchBoard = new SearchBoard(this, cfg.cols, cfg.rows); + this.searchBoard = new SearchBoard(this, cfg.cols, cfg.rows); int idx = 0; boolean evenRow = false; @@ -107,9 +111,8 @@ public abstract class Board implements Disposable, Animation this.selectedTile = selectedTile; } - private void initSides() + private final void initSides() { - this.sides = new Orientation[6]; sides[0] = Orientation.NORTH; sides[1] = Orientation.NORTH_EAST; sides[2] = Orientation.SOUTH_EAST; |