diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2020-06-01 13:52:17 +0200 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2020-06-01 13:52:17 +0200 |
commit | d355fc5e47a1019bde41f2d92398371922e1c9af (patch) | |
tree | 2ca3dd493be98c50819d97f488035179310493fc /test | |
parent | 4dca631629e49b12d44cfbf6682519ea8a7afb0e (diff) | |
download | gdx-boardgame-d355fc5e47a1019bde41f2d92398371922e1c9af.zip gdx-boardgame-d355fc5e47a1019bde41f2d92398371922e1c9af.tar.gz |
Board : add getTile(…), TileProvider goes into BoardFactory
Diffstat (limited to 'test')
-rw-r--r-- | test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java | 2 | ||||
-rw-r--r-- | test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java b/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java index fc6fc30..b964668 100644 --- a/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java +++ b/test/src/ch/asynk/gdx/boardgame/test/AnimationsScreen.java @@ -40,7 +40,7 @@ public class AnimationsScreen extends AbstractScreen super(app, ""); this.map = app.assets.getTexture(app.assets.MAP_00); - this.board = BoardFactory.getBoard(0, 0, BoardFactory.BoardType.HEX, 110, 50, 103, BoardFactory.BoardOrientation.VERTICAL); + this.board = BoardFactory.getBoard(0, 0, BoardFactory.BoardType.HEX, 110, 50, 103, BoardFactory.BoardOrientation.VERTICAL, null); this.camera = this.cam = new Camera(10, map.getWidth(), map.getHeight(), 1.0f, 0.3f, false); Piece.angleCorrection = 90; diff --git a/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java b/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java index 6d762fa..b48c953 100644 --- a/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java +++ b/test/src/ch/asynk/gdx/boardgame/test/BoardScreen.java @@ -130,7 +130,7 @@ public class BoardScreen extends AbstractScreen private void handleAdjacents() { clearAdjacents(); - board.buildAdjacents((int)v.x, (int)v.y, this::getTile); + board.buildAdjacents((int)v.x, (int)v.y); for (Tile tile : board.getAdjacents()) { if (tile != null) { tilesToDraw.add(tile); @@ -146,7 +146,6 @@ public class BoardScreen extends AbstractScreen private Tile getTile(int x, int y) { - if (!board.isOnMap(x, y)) return null; return tileStorage.getTile(x, y, board::genKey, this::buildTile); } @@ -165,7 +164,7 @@ public class BoardScreen extends AbstractScreen dy = 0; w = map.getWidth(); h = map.getHeight(); - board = BoardFactory.getBoard(10, 9, BoardFactory.BoardType.HEX, 110, 50, 103, BoardFactory.BoardOrientation.VERTICAL); + board = BoardFactory.getBoard(10, 9, BoardFactory.BoardType.HEX, 110, 50, 103, BoardFactory.BoardOrientation.VERTICAL, this::getTile); tileStorage = new ArrayTileStorage(board.size()); } @@ -177,7 +176,7 @@ public class BoardScreen extends AbstractScreen dy = - dx; w = map.getHeight(); h = map.getWidth(); - board = BoardFactory.getBoard(9, 10, BoardFactory.BoardType.HEX, 110, 103, 50, BoardFactory.BoardOrientation.HORIZONTAL); + board = BoardFactory.getBoard(9, 10, BoardFactory.BoardType.HEX, 110, 103, 50, BoardFactory.BoardOrientation.HORIZONTAL, this::getTile); tileStorage = new ArrayTileStorage(board.size()); } @@ -189,7 +188,7 @@ public class BoardScreen extends AbstractScreen dy = 0; w = map.getWidth(); h = map.getHeight(); - board = BoardFactory.getBoard(8, 8, BoardFactory.BoardType.SQUARE, 83, 5, 5); + board = BoardFactory.getBoard(8, 8, BoardFactory.BoardType.SQUARE, 83, 5, 5, this::getTile); tileStorage = new ArrayTileStorage(board.size()); } @@ -201,7 +200,7 @@ public class BoardScreen extends AbstractScreen dy = 0; w = map.getWidth(); h = map.getHeight(); - board = BoardFactory.getBoard(21, 8, BoardFactory.BoardType.TRIANGLE, 150, 109, 53, BoardFactory.BoardOrientation.HORIZONTAL); + board = BoardFactory.getBoard(21, 8, BoardFactory.BoardType.TRIANGLE, 150, 109, 53, BoardFactory.BoardOrientation.HORIZONTAL, this::getTile); tileStorage = new ArrayTileStorage(board.size()); } @@ -213,7 +212,7 @@ public class BoardScreen extends AbstractScreen dy = - dx; w = map.getHeight(); h = map.getWidth(); - board = BoardFactory.getBoard(8, 21, BoardFactory.BoardType.TRIANGLE, 150, 16, 110, BoardFactory.BoardOrientation.VERTICAL); + board = BoardFactory.getBoard(8, 21, BoardFactory.BoardType.TRIANGLE, 150, 16, 110, BoardFactory.BoardOrientation.VERTICAL, this::getTile); tileStorage = new ArrayTileStorage(board.size()); } } |