Interface PositionBuilder<T>

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 Details

    • withWhiteTurn

      PositionBuilder<T> withWhiteTurn(boolean whiteTurn)
      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

      PositionBuilder<T> withWhiteKing(int file, int rank)
    • withWhiteQueen

      PositionBuilder<T> withWhiteQueen(int file, int rank)
    • withWhiteRook

      PositionBuilder<T> withWhiteRook(int file, int rank)
    • withWhiteBishop

      PositionBuilder<T> withWhiteBishop(int file, int rank)
    • withWhiteKnight

      PositionBuilder<T> withWhiteKnight(int file, int rank)
    • withWhitePawn

      PositionBuilder<T> withWhitePawn(int file, int rank)
    • withBlackKing

      PositionBuilder<T> withBlackKing(int file, int rank)
    • withBlackQueen

      PositionBuilder<T> withBlackQueen(int file, int rank)
    • withBlackRook

      PositionBuilder<T> withBlackRook(int file, int rank)
    • withBlackBishop

      PositionBuilder<T> withBlackBishop(int file, int rank)
    • withBlackKnight

      PositionBuilder<T> withBlackKnight(int file, int rank)
    • withBlackPawn

      PositionBuilder<T> withBlackPawn(int file, int rank)
    • withCastlingWhiteQueenAllowed

      PositionBuilder<T> withCastlingWhiteQueenAllowed(boolean castlingWhiteQueenAllowed)
      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

      PositionBuilder<T> withCastlingWhiteKingAllowed(boolean castlingWhiteKingAllowed)
      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

      PositionBuilder<T> withCastlingBlackQueenAllowed(boolean castlingBlackQueenAllowed)
      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

      PositionBuilder<T> withCastlingBlackKingAllowed(boolean castlingBlackKingAllowed)
      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

      PositionBuilder<T> withEnPassantSquare(int file, int rank)
      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

      PositionBuilder<T> withHalfMoveClock(int halfMoveClock)
      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

      PositionBuilder<T> withFullMoveClock(int fullMoveClock)
      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.