java.lang.Object
net.chesstango.gardel.AbstractPositionBuilder<T>
- All Implemented Interfaces:
PositionBuilder<T>
- Direct Known Subclasses:
AbstractFENBuilder,ASCIIBuilder,MinChessBuilder
- Author:
- Mauricio Coria
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected longprotected longprotected booleanprotected booleanprotected booleanprotected booleanprotected longprotected intprotected intprotected longprotected longprotected longprotected longprotected longprotected longprotected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionwithBlackBishop(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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.chesstango.gardel.PositionBuilder
getPositionRepresentation
-
Field Details
-
whiteTurn
protected boolean whiteTurn -
castlingBlackKingAllowed
protected boolean castlingBlackKingAllowed -
castlingBlackQueenAllowed
protected boolean castlingBlackQueenAllowed -
castlingWhiteKingAllowed
protected boolean castlingWhiteKingAllowed -
castlingWhiteQueenAllowed
protected boolean castlingWhiteQueenAllowed -
halfMoveClock
protected int halfMoveClock -
fullMoveClock
protected int fullMoveClock -
enPassantSquare
protected long enPassantSquare -
whitePositions
protected long whitePositions -
blackPositions
protected long blackPositions -
kingPositions
protected long kingPositions -
queenPositions
protected long queenPositions -
rookPositions
protected long rookPositions -
bishopPositions
protected long bishopPositions -
knightPositions
protected long knightPositions -
pawnPositions
protected long pawnPositions
-
-
Constructor Details
-
AbstractPositionBuilder
public AbstractPositionBuilder()
-
-
Method Details
-
withWhiteTurn
Description copied from interface:PositionBuilderSets the turn to indicate whether it is White's turn to move.- Specified by:
withWhiteTurnin interfacePositionBuilder<T>- 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<T>
-
withWhiteQueen
- Specified by:
withWhiteQueenin interfacePositionBuilder<T>
-
withWhiteRook
- Specified by:
withWhiteRookin interfacePositionBuilder<T>
-
withWhiteBishop
- Specified by:
withWhiteBishopin interfacePositionBuilder<T>
-
withWhiteKnight
- Specified by:
withWhiteKnightin interfacePositionBuilder<T>
-
withWhitePawn
- Specified by:
withWhitePawnin interfacePositionBuilder<T>
-
withBlackKing
- Specified by:
withBlackKingin interfacePositionBuilder<T>
-
withBlackQueen
- Specified by:
withBlackQueenin interfacePositionBuilder<T>
-
withBlackRook
- Specified by:
withBlackRookin interfacePositionBuilder<T>
-
withBlackBishop
- Specified by:
withBlackBishopin interfacePositionBuilder<T>
-
withBlackKnight
- Specified by:
withBlackKnightin interfacePositionBuilder<T>
-
withBlackPawn
- Specified by:
withBlackPawnin interfacePositionBuilder<T>
-
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<T>- 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<T>- 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<T>- 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<T>- 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<T>- 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<T>- 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<T>- Parameters:
fullMoveClock- The number of full moves in the game.- Returns:
- The current instance of the PositionBuilder.
-