small refactor
All checks were successful
Linux arm64 / Build (push) Successful in 46s

This commit is contained in:
2025-05-04 11:37:15 +02:00
parent 120de055a9
commit 271ff420a2
15 changed files with 69 additions and 127 deletions

View File

@@ -5,15 +5,16 @@ import java.util.List;
import chess.controller.CommandExecutor;
import chess.controller.PlayerCommand;
import chess.controller.commands.NewGameCommand;
import chess.controller.event.GameAdaptator;
import chess.model.Game;
import common.Signal0;
public class PgnSimulator extends GameAdaptator {
private final CommandExecutor commandExecutor;
private final String pgn;
public final Signal0 onComplete = new Signal0();
public PgnSimulator(CommandExecutor commandExecutor, String pgn) {
this.commandExecutor = commandExecutor;
this.pgn = pgn;
@@ -23,6 +24,7 @@ public class PgnSimulator extends GameAdaptator {
public void onGameStart() {
List<PlayerCommand> cmds = PgnImport.importGame(this.pgn);
this.commandExecutor.executeCommands(cmds);
this.onComplete.emit();
}
}