- All Known Implementing Classes:
AbstractFENBuilder,AbstractPositionBuilder,ASCIIBuilder,FENBuilder,MinChessBuilder,MirrorPositionBuilder
public interface PositionBuilder<T>
Interface for building a chess position. A chess positions consists of:
- Piece placement on the Board Representation
- Side to move
- Castling Rights
- En passant target square
- Halfmove Clock
- Author:
- Mauricio Coria
-
Method Summary
Modifier and TypeMethodDescriptionGets the chess position representation built by this builder.withBlackBishop(int file, int rank) withBlackKing(int file, int rank) withBlackKnight(int file, int rank) withBlackPawn(int file, int rank) withBlackQueen(int file, int rank) withBlackRook(int file, int rank) withCastlingBlackKingAllowed(boolean castlingBlackKingAllowed) Sets whether castling with the black king is allowed.withCastlingBlackQueenAllowed(boolean castlingBlackQueenAllowed) Sets whether castling with the black queen is allowed.withCastlingWhiteKingAllowed(boolean castlingWhiteKingAllowed) Sets whether castling with the white king is allowed.withCastlingWhiteQueenAllowed(boolean castlingWhiteQueenAllowed) Sets whether castling with the white queen is allowed.withEnPassantSquare(int file, int rank) Sets the en passant square, which indicates the target square of a possible en passant capture.withFullMoveClock(int fullMoveClock) Sets the full-move clock.withHalfMoveClock(int halfMoveClock) Sets the half-move clock.withWhiteBishop(int file, int rank) withWhiteKing(int file, int rank) withWhiteKnight(int file, int rank) withWhitePawn(int file, int rank) withWhiteQueen(int file, int rank) withWhiteRook(int file, int rank) withWhiteTurn(boolean whiteTurn) Sets the turn to indicate whether it is White's turn to move.
-
Method Details
-
withWhiteTurn
Sets the turn to indicate whether it is White's turn to move.- Parameters:
whiteTurn- True if it is White's turn to move, false if it is Black's turn.- Returns:
- The current instance of the PositionBuilder.
-
withWhiteKing
-
withWhiteQueen
-
withWhiteRook
-
withWhiteBishop
-
withWhiteKnight
-
withWhitePawn
-
withBlackKing
-
withBlackQueen
-
withBlackRook
-
withBlackBishop
-
withBlackKnight
-
withBlackPawn
-
withCastlingWhiteQueenAllowed
Sets whether castling with the white queen is allowed.- Parameters:
castlingWhiteQueenAllowed- True if castling with the white queen is allowed, false otherwise.- Returns:
- The current instance of the PositionBuilder.
-
withCastlingWhiteKingAllowed
Sets whether castling with the white king is allowed.- Parameters:
castlingWhiteKingAllowed- True if castling with the white king is allowed, false otherwise.- Returns:
- The current instance of the PositionBuilder.
-
withCastlingBlackQueenAllowed
Sets whether castling with the black queen is allowed.- Parameters:
castlingBlackQueenAllowed- True if castling with the black queen is allowed, false otherwise.- Returns:
- The current instance of the PositionBuilder.
-
withCastlingBlackKingAllowed
Sets whether castling with the black king is allowed.- Parameters:
castlingBlackKingAllowed- True if castling with the black king is allowed, false otherwise.- Returns:
- The current instance of the PositionBuilder.
-
withEnPassantSquare
Sets the en passant square, which indicates the target square of a possible en passant capture.- Parameters:
file- The file of the en passant square (0-based index).rank- The rank of the en passant square (0-based index).- Returns:
- The current instance of the PositionBuilder.
-
withHalfMoveClock
Sets the half-move clock.- Parameters:
halfMoveClock- The number of half-moves since the last capture or pawn move.- Returns:
- The current instance of the PositionBuilder.
-
withFullMoveClock
Sets the full-move clock.- Parameters:
fullMoveClock- The number of full moves in the game.- Returns:
- The current instance of the PositionBuilder.
-
getPositionRepresentation
T getPositionRepresentation()Gets the chess position representation built by this builder.- Returns:
- The chess representation.
-