add CommanderSender (Fixes #9)
All checks were successful
Linux arm64 / Build (push) Successful in 36s
All checks were successful
Linux arm64 / Build (push) Successful in 36s
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user