- All Implemented Interfaces:
PositionBuilder<String>
- Author:
- Mauricio Coria
-
Field Summary
Fields inherited from class net.chesstango.gardel.AbstractPositionBuilder
bishopPositions, blackPositions, castlingBlackKingAllowed, castlingBlackQueenAllowed, castlingWhiteKingAllowed, castlingWhiteQueenAllowed, enPassantSquare, fullMoveClock, halfMoveClock, kingPositions, knightPositions, pawnPositions, queenPositions, rookPositions, whitePositions, whiteTurn -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the chess position representation built by this builder.voidprintFEN(PrintStream printStream) voidprintPiecePlacement(PrintStream printStream) 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.
-
Constructor Details
-
ASCIIBuilder
public ASCIIBuilder()
-
-
Method Details
-
getPositionRepresentation
Description copied from interface:PositionBuilderGets the chess position representation built by this builder.- Returns:
- The chess representation.
-
printFEN
-
printPiecePlacement
-
withWhiteTurn
Description copied from interface:PositionBuilderSets the turn to indicate whether it is White's turn to move.- Specified by:
withWhiteTurnin interfacePositionBuilder<String>- Overrides:
withWhiteTurnin classAbstractPositionBuilder<String>- 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
- Specified by:
withWhiteKingin interfacePositionBuilder<String>- Overrides:
withWhiteKingin classAbstractPositionBuilder<String>
-
withWhiteQueen
- Specified by:
withWhiteQueenin interfacePositionBuilder<String>- Overrides:
withWhiteQueenin classAbstractPositionBuilder<String>
-
withWhiteRook
- Specified by:
withWhiteRookin interfacePositionBuilder<String>- Overrides:
withWhiteRookin classAbstractPositionBuilder<String>
-
withWhiteBishop
- Specified by:
withWhiteBishopin interfacePositionBuilder<String>- Overrides:
withWhiteBishopin classAbstractPositionBuilder<String>
-
withWhiteKnight
- Specified by:
withWhiteKnightin interfacePositionBuilder<String>- Overrides:
withWhiteKnightin classAbstractPositionBuilder<String>
-
withWhitePawn
- Specified by:
withWhitePawnin interfacePositionBuilder<String>- Overrides:
withWhitePawnin classAbstractPositionBuilder<String>
-
withBlackKing
- Specified by:
withBlackKingin interfacePositionBuilder<String>- Overrides:
withBlackKingin classAbstractPositionBuilder<String>
-
withBlackQueen
- Specified by:
withBlackQueenin interfacePositionBuilder<String>- Overrides:
withBlackQueenin classAbstractPositionBuilder<String>
-
withBlackRook
- Specified by:
withBlackRookin interfacePositionBuilder<String>- Overrides:
withBlackRookin classAbstractPositionBuilder<String>
-
withBlackBishop
- Specified by:
withBlackBishopin interfacePositionBuilder<String>- Overrides:
withBlackBishopin classAbstractPositionBuilder<String>
-
withBlackKnight
- Specified by:
withBlackKnightin interfacePositionBuilder<String>- Overrides:
withBlackKnightin classAbstractPositionBuilder<String>
-
withBlackPawn
- Specified by:
withBlackPawnin interfacePositionBuilder<String>- Overrides:
withBlackPawnin classAbstractPositionBuilder<String>
-
withEnPassantSquare
Description copied from interface:PositionBuilderSets the en passant square, which indicates the target square of a possible en passant capture.- Specified by:
withEnPassantSquarein interfacePositionBuilder<String>- Overrides:
withEnPassantSquarein classAbstractPositionBuilder<String>- 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.
-
withCastlingBlackKingAllowed
Description copied from interface:PositionBuilderSets whether castling with the black king is allowed.- Specified by:
withCastlingBlackKingAllowedin interfacePositionBuilder<String>- Overrides:
withCastlingBlackKingAllowedin classAbstractPositionBuilder<String>- Parameters:
castlingBlackKingAllowed- True if castling with the black king is allowed, false otherwise.- Returns:
- The current instance of the PositionBuilder.
-
withCastlingBlackQueenAllowed
Description copied from interface:PositionBuilderSets whether castling with the black queen is allowed.- Specified by:
withCastlingBlackQueenAllowedin interfacePositionBuilder<String>- Overrides:
withCastlingBlackQueenAllowedin classAbstractPositionBuilder<String>- Parameters:
castlingBlackQueenAllowed- True if castling with the black queen is allowed, false otherwise.- Returns:
- The current instance of the PositionBuilder.
-
withCastlingWhiteKingAllowed
Description copied from interface:PositionBuilderSets whether castling with the white king is allowed.- Specified by:
withCastlingWhiteKingAllowedin interfacePositionBuilder<String>- Overrides:
withCastlingWhiteKingAllowedin classAbstractPositionBuilder<String>- Parameters:
castlingWhiteKingAllowed- True if castling with the white king is allowed, false otherwise.- Returns:
- The current instance of the PositionBuilder.
-
withCastlingWhiteQueenAllowed
Description copied from interface:PositionBuilderSets whether castling with the white queen is allowed.- Specified by:
withCastlingWhiteQueenAllowedin interfacePositionBuilder<String>- Overrides:
withCastlingWhiteQueenAllowedin classAbstractPositionBuilder<String>- Parameters:
castlingWhiteQueenAllowed- True if castling with the white queen is allowed, false otherwise.- Returns:
- The current instance of the PositionBuilder.
-
withHalfMoveClock
Description copied from interface:PositionBuilderSets the half-move clock.- Specified by:
withHalfMoveClockin interfacePositionBuilder<String>- Overrides:
withHalfMoveClockin classAbstractPositionBuilder<String>- Parameters:
halfMoveClock- The number of half-moves since the last capture or pawn move.- Returns:
- The current instance of the PositionBuilder.
-
withFullMoveClock
Description copied from interface:PositionBuilderSets the full-move clock.- Specified by:
withFullMoveClockin interfacePositionBuilder<String>- Overrides:
withFullMoveClockin classAbstractPositionBuilder<String>- Parameters:
fullMoveClock- The number of full moves in the game.- Returns:
- The current instance of the PositionBuilder.
-