29 lines
593 B
Java
29 lines
593 B
Java
package chess.ai.actions;
|
|
|
|
import chess.controller.CommandExecutor;
|
|
import chess.controller.commands.MoveCommand;
|
|
import chess.model.Move;
|
|
|
|
/**
|
|
* Manage the transition between model and bots when it comes to Move command.
|
|
*/
|
|
public class AIActionMove extends AIAction{
|
|
|
|
private final Move move;
|
|
|
|
public AIActionMove(CommandExecutor commandExecutor, Move move) {
|
|
super(commandExecutor);
|
|
this.move = move;
|
|
}
|
|
|
|
public Move getMove() {
|
|
return move;
|
|
}
|
|
|
|
@Override
|
|
public void applyAction(CommandExecutor commandExecutor) {
|
|
sendCommand(new MoveCommand(move), commandExecutor);
|
|
}
|
|
|
|
}
|