diff --git a/src/GameController.java b/src/GameController.java index 1c5e392..f4b7eca 100644 --- a/src/GameController.java +++ b/src/GameController.java @@ -25,6 +25,9 @@ public class GameController { public static int semesterToBoardSize(int semester) { return semester + 13; } + public static int boardSizeToSemester(int size) { + return size - 13; + } public static HashMap> supportedVersions = new HashMap<>(Map.of( "1.1.0", OnlinePlayer_1_1_0.class @@ -93,7 +96,7 @@ public class GameController { localPlayer.isServer = localPlayerIsServer; onlinePlayer.isServer = !localPlayerIsServer; - startGameWithInstancedPlayers(localPlayer, onlinePlayer); + startGameWithInstancedPlayers(localPlayer, onlinePlayer, size); } else { throw new RuntimeException("Unexpected Package received before game initialisation"); @@ -178,13 +181,15 @@ public class GameController { localPlayer.createBoard(size); aiPlayer.createBoard(size); - startGameWithInstancedPlayers(localPlayer, aiPlayer); + startGameWithInstancedPlayers(localPlayer, aiPlayer, size); } - private static void startGameWithInstancedPlayers(LocalPlayer p1, Player p2) { + private static void startGameWithInstancedPlayers(LocalPlayer p1, Player p2, int boardSize) { p1.setEnemy(p2); p2.setEnemy(p1); + mainFrame.showPanelSLG("GameBoard", boardSizeToSemester(boardSize), p1, p2); + // TODO: frontend configuration }