Files
3DChess/app/src/main/java/chess/SwingMain.java
2025-04-18 18:42:28 +02:00

41 lines
1.2 KiB
Java

package chess;
import chess.ai.AlphaBetaAI;
import chess.ai.DumbAI;
import chess.ai.HungryAI;
import chess.controller.CommandExecutor;
import chess.controller.commands.NewGameCommand;
import chess.controller.event.GameAdaptator;
import chess.model.Color;
import chess.model.Game;
import chess.pgn.PgnExport;
import chess.view.simplerender.Window;
public class SwingMain {
public static void main(String[] args) {
Game game = new Game();
CommandExecutor commandExecutor = new CommandExecutor(game);
Window window = new Window(commandExecutor, false);
commandExecutor.addListener(window);
DumbAI ai = new DumbAI(commandExecutor, Color.White);
commandExecutor.addListener(ai);
AlphaBetaAI ai2 = new AlphaBetaAI(commandExecutor, Color.Black, 3);
commandExecutor.addListener(ai2);
// Window window2 = new Window(ai2.getSimulation(), false);
// ai2.getSimulation().addListener(window2);
commandExecutor.addListener(new GameAdaptator(){
@Override
public void onGameEnd() {
System.out.println(PgnExport.exportGame(game));
}
});
commandExecutor.executeCommand(new NewGameCommand());
}
}