diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2018-09-13 16:38:47 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2018-09-13 16:38:47 +0200 |
commit | 3ff7f6af6e3653febd3a58ebb35f3a10b774ad73 (patch) | |
tree | aacf0b69e3c9c7cbb794ca0333afaef9dd5cc082 /core/src/ch/asynk | |
parent | fa8345b7c6c7c22620117f34ef9fbd63f1004b41 (diff) | |
download | gdx-boardgame-3ff7f6af6e3653febd3a58ebb35f3a10b774ad73.zip gdx-boardgame-3ff7f6af6e3653febd3a58ebb35f3a10b774ad73.tar.gz |
Board : don't need cols and rows
Diffstat (limited to 'core/src/ch/asynk')
-rw-r--r-- | core/src/ch/asynk/zproject/engine/board/BoardFactory.java | 12 | ||||
-rw-r--r-- | core/src/ch/asynk/zproject/engine/board/HexBoard.java | 6 |
2 files changed, 7 insertions, 11 deletions
diff --git a/core/src/ch/asynk/zproject/engine/board/BoardFactory.java b/core/src/ch/asynk/zproject/engine/board/BoardFactory.java index a81e963..695d33e 100644 --- a/core/src/ch/asynk/zproject/engine/board/BoardFactory.java +++ b/core/src/ch/asynk/zproject/engine/board/BoardFactory.java @@ -15,22 +15,22 @@ public class BoardFactory HORIZONTAL, } - public static Board getBoard(BoardType boardType, int cols, int rows, float side) + public static Board getBoard(BoardType boardType, float side) { - return getBoard(boardType, cols, rows, side, 0f, 0f, BoardOrientation.VERTICAL); + return getBoard(boardType, side, 0f, 0f, BoardOrientation.VERTICAL); } - public static Board getBoard(BoardType boardType, int cols, int rows, float side, float x0, float y0) + public static Board getBoard(BoardType boardType, float side, float x0, float y0) { - return getBoard(boardType, cols, rows, side, x0, y0, BoardOrientation.VERTICAL); + return getBoard(boardType, side, x0, y0, BoardOrientation.VERTICAL); } - public static Board getBoard(BoardType boardType, int cols, int rows, float side, float x0, float y0, BoardOrientation boardOrientation) + public static Board getBoard(BoardType boardType, float side, float x0, float y0, BoardOrientation boardOrientation) { switch(boardType) { case HEX: - return new HexBoard(cols, rows, side, x0, y0, boardOrientation); + return new HexBoard(side, x0, y0, boardOrientation); default: throw new RuntimeException( String.format("%s board type is not implemented yet.", boardType) ); } diff --git a/core/src/ch/asynk/zproject/engine/board/HexBoard.java b/core/src/ch/asynk/zproject/engine/board/HexBoard.java index 24ce535..c279d16 100644 --- a/core/src/ch/asynk/zproject/engine/board/HexBoard.java +++ b/core/src/ch/asynk/zproject/engine/board/HexBoard.java @@ -6,8 +6,6 @@ import ch.asynk.zproject.engine.Board; public class HexBoard implements Board { - private int cols; // # columns - private int rows; // # rows private float side; // length of the side of the hex private float x0; // bottom left x offset private float y0; // bottom left y offset @@ -37,10 +35,8 @@ public class HexBoard implements Board // rows are vertical° // bottom left is the left vertice of the most bottom-left horizontal hex side of the map - public HexBoard(int cols, int rows, float side, float x0, float y0, BoardFactory.BoardOrientation boardOrientation) + public HexBoard(float side, float x0, float y0, BoardFactory.BoardOrientation boardOrientation) { - this.cols = cols; - this.rows = rows; this.side = side; this.x0 = x0; this.y0 = y0; |