player command
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
package chess.io.commands;
|
||||
|
||||
import chess.io.Command;
|
||||
import chess.io.CommandResult;
|
||||
import chess.io.OutputSystem;
|
||||
import chess.io.PlayerCommand;
|
||||
import chess.model.ChessBoard;
|
||||
import chess.model.Game;
|
||||
import chess.model.Move;
|
||||
import chess.model.Piece;
|
||||
import chess.model.visitor.PiecePathChecker;
|
||||
|
||||
public class MoveCommand extends Command {
|
||||
public class MoveCommand extends PlayerCommand {
|
||||
private final Move move;
|
||||
|
||||
public MoveCommand(Move move) {
|
||||
@@ -49,4 +49,9 @@ public class MoveCommand extends Command {
|
||||
return CommandResult.Moved;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void undo(Game game, OutputSystem outputSystem) {
|
||||
game.getBoard().undoLastMove();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user