Tests and better instantiation

This commit is contained in:
lieght
2025-12-12 16:47:17 +01:00
parent c30c118c04
commit a60c702306
10 changed files with 136 additions and 34 deletions

View File

@@ -141,17 +141,6 @@ public final class App extends Application {
}
stage.show();
var games = new ConcurrentHashMap<String, Class<? extends TurnBasedGame>>();
games.put("tictactoe", BitboardReversi.class);
games.put("reversi", BitboardReversi.class);
var s = new MasterServer(6666, games);
try {
s.start();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
private void setKeybinds(StackPane root) {

View File

@@ -10,7 +10,8 @@ import org.toop.framework.game.players.OnlinePlayer;
public class ReversiBitController extends GenericGameController {
public ReversiBitController(Player[] players) {
BitboardReversi game = new BitboardReversi(players);
BitboardReversi game = new BitboardReversi();
game.init(players);
ThreadBehaviour thread = new LocalThreadBehaviour(game);
for (Player player : players) {
if (player instanceof OnlinePlayer){

View File

@@ -10,7 +10,8 @@ import org.toop.framework.game.players.OnlinePlayer;
public class TicTacToeBitController extends GenericGameController {
public TicTacToeBitController(Player[] players) {
BitboardTicTacToe game = new BitboardTicTacToe(players);
BitboardTicTacToe game = new BitboardTicTacToe();
game.init(players);
ThreadBehaviour thread = new LocalThreadBehaviour(game);
for (Player player : players) {
if (player instanceof OnlinePlayer){