fix console promote

This commit is contained in:
2025-04-15 18:31:09 +02:00
parent 1a038a3de1
commit ae0e76a452
5 changed files with 108 additions and 59 deletions

View File

@@ -7,7 +7,7 @@ import chess.controller.CommandExecutor;
import chess.controller.commands.NewGameCommand;
import chess.model.ChessBoard;
import chess.model.Game;
import chess.simulator.CastlingTest;
import chess.simulator.PromoteTest;
import chess.view.consolerender.Console;
public class ConsoleMain {
@@ -15,8 +15,15 @@ public class ConsoleMain {
Game game = new Game(new ChessBoard());
CommandExecutor commandExecutor = new CommandExecutor(game);
PromoteTest promoteTest = new PromoteTest(commandExecutor);
commandExecutor.addListener(promoteTest);
Console console = new Console(commandExecutor);
commandExecutor.addListener(console);
promoteTest.onComplete.connect(() -> {
console.setCaptureInput(true);
});
commandExecutor.executeCommand(new NewGameCommand());
}