add CommanderSender (Fixes #9)
All checks were successful
Linux arm64 / Build (push) Successful in 36s

This commit is contained in:
2025-05-17 16:48:04 +02:00
parent b33e333276
commit 90daf662ea
6 changed files with 179 additions and 164 deletions

View File

@@ -1,11 +1,10 @@
package chess.ai.actions;
import chess.controller.Command;
import chess.controller.CommandExecutor;
import chess.controller.Command.CommandResult;
import chess.controller.CommandSender;
import chess.controller.commands.UndoCommand;
public abstract class AIAction {
public abstract class AIAction implements CommandSender {
private final CommandExecutor commandExecutor;
@@ -13,8 +12,9 @@ public abstract class AIAction {
this.commandExecutor = commandExecutor;
}
protected CommandResult sendCommand(Command cmd, CommandExecutor commandExecutor) {
return commandExecutor.executeCommand(cmd);
@Override
public CommandExecutor getCommandExecutor() {
return this.commandExecutor;
}
public void undoAction(CommandExecutor commandExecutor) {