25 lines
632 B
Java
25 lines
632 B
Java
package chess.controller.commands;
|
|
|
|
import chess.controller.OutputSystem;
|
|
import chess.controller.PlayerCommand;
|
|
import chess.model.Game;
|
|
|
|
public class CastlingCommand extends PlayerCommand {
|
|
|
|
@Override
|
|
public CommandResult execute(Game game, OutputSystem outputSystem) {
|
|
// we must promote the pending pawn before
|
|
if (game.pawnShouldBePromoted())
|
|
return CommandResult.NotAllowed;
|
|
|
|
return CommandResult.NotAllowed;
|
|
}
|
|
|
|
@Override
|
|
protected CommandResult undoImpl(Game game, OutputSystem outputSystem) {
|
|
// TODO Auto-generated method stub
|
|
throw new UnsupportedOperationException("Unimplemented method 'undo'");
|
|
}
|
|
|
|
}
|