add simulators for testing

This commit is contained in:
2025-04-13 12:30:12 +02:00
parent a23c334994
commit 224a09c711
3 changed files with 96 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package chess.simulator;
import java.util.List;
import chess.controller.CommandExecutor;
import chess.controller.commands.MoveCommand;
import chess.controller.event.GameAdaptator;
import chess.model.Move;
public abstract class Simulator extends GameAdaptator{
protected final CommandExecutor commandExecutor;
public Simulator(CommandExecutor commandExecutor) {
this.commandExecutor = commandExecutor;
}
@Override
public void onGameStart() {
for (Move move : getMoves()) {
this.commandExecutor.executeCommand(new MoveCommand(move));
}
}
protected abstract List<Move> getMoves();
}