Standard Castling
class StandardCastling(p1CanCastleLeft: Boolean, p1CanCastleRight: Boolean, p2CanCastleLeft: Boolean, p2CanCastleRight: Boolean) : AbstractCastling<StandardChess>
Content copied to clipboard
Castling in standard chess.
Moves the king two squares towards a rook on the player's first rank, then moving the rook to the square that the king crossed.
Can only occur provided all of the following conditions hold:
The castling must be kingside or queenside
Neither the king nor the chosen rook has previously moved.
There are no pieces between the king and the chosen rook.
The king is not currently in check.
The king does not pass through a square that is attacked by an enemy piece.
The king does not end up in check. (True of any legal move.)
Constructors
StandardCastling
Link copied to clipboard
fun StandardCastling(p1CanCastleLeft: Boolean = true, p1CanCastleRight: Boolean = true, p2CanCastleLeft: Boolean = true, p2CanCastleRight: Boolean = true)
Content copied to clipboard
Functions
getPossibleMoves
Link copied to clipboard
open override fun getPossibleMoves(game: StandardChess, player: Player, moves: MutableList<Move2D>)
Content copied to clipboard