Files
3DChess/app/src/main/java/chess/SwingMain.java
2025-04-12 12:15:58 +02:00

28 lines
823 B
Java

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;
public class SwingMain {
public static void main(String[] args) {
Game game = new Game(new ChessBoard());
CommandExecutor commandExecutor = new CommandExecutor(game);
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());
}
}