thread pool + ai vs ai

This commit is contained in:
2025-04-12 12:15:58 +02:00
parent acd20ef7fa
commit d2485a4d75
4 changed files with 123 additions and 50 deletions

View File

@@ -1,8 +1,10 @@
package chess;
import chess.ai.DumbAI;
import chess.controller.CommandExecutor;
import chess.controller.commands.NewGameCommand;
import chess.model.ChessBoard;
import chess.model.Color;
import chess.model.Game;
import chess.view.simplerender.Window;
@@ -11,9 +13,15 @@ public class SwingMain {
Game game = new Game(new ChessBoard());
CommandExecutor commandExecutor = new CommandExecutor(game);
Window window = new Window(commandExecutor);
Window window = new Window(commandExecutor, false);
commandExecutor.addListener(window);
DumbAI ai = new DumbAI(commandExecutor, Color.Black);
commandExecutor.addListener(ai);
DumbAI ai2 = new DumbAI(commandExecutor, Color.White);
commandExecutor.addListener(ai2);
commandExecutor.executeCommand(new NewGameCommand());
}
}