|
| enum class | Square : SquareUnderlyingType {
Square::A1 = 0U
, Square::B1 = 1U
, Square::C1 = 2U
, Square::D1 = 3U
,
Square::E1 = 4U
, Square::F1 = 5U
, Square::G1 = 6U
, Square::H1 = 7U
,
Square::A2 = 8U
, Square::B2 = 9U
, Square::C2 = 10U
, Square::D2 = 11U
,
Square::E2 = 12U
, Square::F2 = 13U
, Square::G2 = 14U
, Square::H2 = 15U
,
Square::A3 = 16U
, Square::B3 = 17U
, Square::C3 = 18U
, Square::D3 = 19U
,
Square::E3 = 20U
, Square::F3 = 21U
, Square::G3 = 22U
, Square::H3 = 23U
,
Square::A4 = 24U
, Square::B4 = 25U
, Square::C4 = 26U
, Square::D4 = 27U
,
Square::E4 = 28U
, Square::F4 = 29U
, Square::G4 = 30U
, Square::H4 = 31U
,
Square::A5 = 32U
, Square::B5 = 33U
, Square::C5 = 34U
, Square::D5 = 35U
,
Square::E5 = 36U
, Square::F5 = 37U
, Square::G5 = 38U
, Square::H5 = 39U
,
Square::A6 = 40U
, Square::B6 = 41U
, Square::C6 = 42U
, Square::D6 = 43U
,
Square::E6 = 44U
, Square::F6 = 45U
, Square::G6 = 46U
, Square::H6 = 47U
,
Square::A7 = 48U
, Square::B7 = 49U
, Square::C7 = 50U
, Square::D7 = 51U
,
Square::E7 = 52U
, Square::F7 = 53U
, Square::G7 = 54U
, Square::H7 = 55U
,
Square::A8 = 56U
, Square::B8 = 57U
, Square::C8 = 58U
, Square::D8 = 59U
,
Square::E8 = 60U
, Square::F8 = 61U
, Square::G8 = 62U
, Square::H8 = 63U
,
Square::NONE = 64U
} |
| | Named square. More...
|
| |
| enum class | Color : ColorUnderlyingType { Color::WHITE = 0U
, Color::BLACK = 8U
} |
| | Color of a piece or side to move. More...
|
| |
| enum class | Piece : PieceUnderlyingType {
Piece::NONE = 0U
, Piece::PAWN
, Piece::KNIGHT
, Piece::BISHOP
,
Piece::ROOK
, Piece::QUEEN
, Piece::KING
} |
| | Named piece. More...
|
| |
| enum class | PieceAndColor : PieceAndColorUnderlyingType {
PieceAndColor::NONE = 0U
, PieceAndColor::WHITE_PAWN = 1U
, PieceAndColor::WHITE_KNIGHT
, PieceAndColor::WHITE_BISHOP
,
PieceAndColor::WHITE_ROOK
, PieceAndColor::WHITE_QUEEN
, PieceAndColor::WHITE_KING
, PieceAndColor::BLACK_PAWN = 9U
,
PieceAndColor::BLACK_KNIGHT
, PieceAndColor::BLACK_BISHOP
, PieceAndColor::BLACK_ROOK
, PieceAndColor::BLACK_QUEEN
,
PieceAndColor::BLACK_KING
, PieceAndColor::WHITE_NONE = 0U
, PieceAndColor::BLACK_NONE = 8U
} |
| | Named piece and color. More...
|
| |
| enum class | PieceAndColorCompact : PieceAndColorCompactType {
PieceAndColorCompact::NONE = 0U
, PieceAndColorCompact::WHITE_PAWN = 1U
, PieceAndColorCompact::WHITE_KNIGHT
, PieceAndColorCompact::WHITE_BISHOP
,
PieceAndColorCompact::WHITE_ROOK
, PieceAndColorCompact::WHITE_QUEEN
, PieceAndColorCompact::WHITE_KING
, PieceAndColorCompact::BLACK_PAWN = 9U
,
PieceAndColorCompact::BLACK_KNIGHT
, PieceAndColorCompact::BLACK_BISHOP
, PieceAndColorCompact::BLACK_ROOK
, PieceAndColorCompact::BLACK_QUEEN
,
PieceAndColorCompact::BLACK_KING
, PieceAndColorCompact::WHITE_NONE = 0U
, PieceAndColorCompact::BLACK_NONE = 8U
} |
| | Named piece and color (compact representation) More...
|
| |
| enum class | PositionStatus : PositionStatusUnderlyingType { PositionStatus::NORMAL
, PositionStatus::CHECK
, PositionStatus::STALEMATE
, PositionStatus::MATE
} |
| | Status of a position. More...
|
| |
| enum class | MoveTypeAndPromotion : MoveTypeAndPromotionUnderlyingType {
MoveTypeAndPromotion::REGULAR_PAWN_MOVE = 0U
, MoveTypeAndPromotion::REGULAR_KNIGHT_MOVE = 1U
, MoveTypeAndPromotion::REGULAR_BISHOP_MOVE = 2U
, MoveTypeAndPromotion::REGULAR_ROOK_MOVE = 3U
,
MoveTypeAndPromotion::REGULAR_QUEEN_MOVE = 4U
, MoveTypeAndPromotion::REGULAR_KING_MOVE = 5U
, MoveTypeAndPromotion::CASTLING_SHORT = 6U
, MoveTypeAndPromotion::CASTLING_LONG = 7U
,
MoveTypeAndPromotion::PROMO_KNIGHT = 8U
, MoveTypeAndPromotion::PROMO_BISHOP = 9U
, MoveTypeAndPromotion::PROMO_ROOK = 10U
, MoveTypeAndPromotion::PROMO_QUEEN = 11U
,
MoveTypeAndPromotion::EN_PASSANT = 12U
, MoveTypeAndPromotion::ILLEGAL = 15U
} |
| | Move type (4 bits, range: 0..15) More...
|
| |
| enum class | MoveGenType { MoveGenType::NO_CHECK = 0U
, MoveGenType::CHECK
, MoveGenType::DOUBLE_CHECK
} |
| | Move generator type. More...
|
| |
| enum class | PgnErrorCode : unsigned {
PgnErrorCode::OK = 0U
, PgnErrorCode::BAD_CHARACTER = 1U
, PgnErrorCode::BAD_PGN_TAG
, PgnErrorCode::UNEXPECTED_MOVE_NUM
,
PgnErrorCode::UNEXPECTED_TOKEN
, PgnErrorCode::BAD_FEN
, PgnErrorCode::ILLEGAL_MOVE
, PgnErrorCode::AMBIGUOUS_MOVE
,
PgnErrorCode::UNIMPLEMENTED
, PgnErrorCode::INTERNAL_ERROR
} |
| | Error code. More...
|
| |
| enum class | PgnResult : std::uint_fast8_t { PgnResult::WHITE_WIN
, PgnResult::BLACK_WIN
, PgnResult::DRAW
, PgnResult::UNKNOWN
} |
| | Game result. More...
|
| |
| enum class | PgnReaderOnErrorAction { PgnReaderOnErrorAction::Abort
, PgnReaderOnErrorAction::ContinueFromNextGame
} |
| | Action for recoverable PGN reader error. More...
|
| |
| enum class | PgnReaderActionClass : unsigned int {
PgnReaderActionClass::PgnTag = 0U
, PgnReaderActionClass::Move
, PgnReaderActionClass::NAG
, PgnReaderActionClass::Variation
,
PgnReaderActionClass::Comment
} |
| | PGN reader filterable action classes. More...
|
| |
| enum class | CompressedPosition_PieceEncoding {
CompressedPosition_PieceEncoding::WHITE_KING_NOT_IN_TURN = 0U
, CompressedPosition_PieceEncoding::WHITE_BISHOP = 1U
, CompressedPosition_PieceEncoding::WHITE_ROOK_CANNOT_CASTLE = 2U
, CompressedPosition_PieceEncoding::WHITE_QUEEN = 3U
,
CompressedPosition_PieceEncoding::WHITE_KNIGHT = 4U
, CompressedPosition_PieceEncoding::WHITE_PAWN = 5U
, CompressedPosition_PieceEncoding::WHITE_ROOK_CAN_CASTLE = 6U
, CompressedPosition_PieceEncoding::WHITE_KING_IN_TURN = 7U
,
CompressedPosition_PieceEncoding::EP_PAWN = 8U
, CompressedPosition_PieceEncoding::BLACK_BISHOP = 9U
, CompressedPosition_PieceEncoding::BLACK_ROOK_CANNOT_CASTLE = 10U
, CompressedPosition_PieceEncoding::BLACK_QUEEN = 11U
,
CompressedPosition_PieceEncoding::BLACK_KNIGHT = 12U
, CompressedPosition_PieceEncoding::BLACK_PAWN = 13U
, CompressedPosition_PieceEncoding::BLACK_ROOK_CAN_CASTLE = 14U
, CompressedPosition_PieceEncoding::BLACK_KING = 15U
} |
| | Compressed piece encoding for fixed-length compressed position. More...
|
| |
| enum | PgnScannerToken : std::uint8_t {
NONE = 0U
, END_OF_FILE
, TAG_START
, TAG_KEY
,
TAG_VALUE
, TAG_END
, VARIATION_START
, VARIATION_END
,
MOVENUM
, MOVE_PAWN
, MOVE_PAWN_CAPTURE
, MOVE_PAWN_PROMO
,
MOVE_PAWN_PROMO_CAPTURE
, MOVE_PIECE_KNIGHT
, MOVE_PIECE_BISHOP
, MOVE_PIECE_ROOK
,
MOVE_PIECE_QUEEN
, MOVE_PIECE_KING
, MOVE_SHORT_CASTLE
, MOVE_LONG_CASTLE
,
NAG
, COMMENT_START
, COMMENT_TEXT
, COMMENT_NEWLINE
,
COMMENT_END
, RESULT
, ERROR
} |
| | PGN scanner token. More...
|
| |
|
| constexpr bool | isValidValue (Square sq) noexcept |
| | Checks whether a value is a valid enumeration value.
|
| |
| constexpr bool | isValidSquare (Square sq) noexcept |
| | Checks whether a value is a square.
|
| |
| constexpr Square | makeSquare (RowColumn col, RowColumn row) noexcept |
| | Constructs a square from column and row.
|
| |
| constexpr RowColumn | columnOf (Square sq) noexcept |
| | Returns column number of square.
|
| |
| constexpr RowColumn | rowOf (Square sq) noexcept |
| | Returns row number of square.
|
| |
| constexpr Square | getSquareForIndex (std::size_t index) noexcept |
| | Returns a square for an index. In essence, this is the ordinal of the square.
|
| |
| constexpr std::size_t | getIndexOfSquare (Square sq) noexcept |
| | Returns an index for a square.
|
| |
| constexpr Square | addToSquareNoOverflowCheck (Square sq, std::int_fast8_t shift) noexcept |
| | Adds to square. This function performs no overflow checking.
|
| |
| constexpr bool | isValidValue (Color c) noexcept |
| | Checks whether a value is a valid enumeration value.
|
| |
| constexpr Color | oppositeColor (Color c) noexcept |
| | Flips the color.
|
| |
| constexpr Color | colorOf (PieceAndColor pc) noexcept |
| | Returns color of a piece.
|
| |
| constexpr bool | isValidValue (Piece p) noexcept |
| | Checks whether a value is a valid enumeration value.
|
| |
| constexpr bool | isValidValue (PieceAndColor pc) noexcept |
| | Checks whether a value is a valid enumeration value.
|
| |
| constexpr Piece | pieceOf (PieceAndColor pc) noexcept |
| | Returns piece of a piece and color enumeration value.
|
| |
| constexpr PieceAndColor | makePieceAndColor (Piece p, Color c) noexcept |
| | Constructs a PieceAndColor enumeration value from Piece and Color.
|
| |
| constexpr PieceAndColorCompact | toCompactType (PieceAndColor pc) noexcept |
| | Converts PieceAndColor (fast type) to PieceAndColorCompact (compact type).
|
| |
| constexpr PieceAndColor | toFastType (PieceAndColorCompact pc) noexcept |
| | Converts PieceAndColorCompact (compact type) to PieceAndColor (fast type).
|
| |
| constexpr std::uint_fast32_t | makePlyNum (std::uint_fast32_t moveNum, Color color) noexcept |
| | Computes the ply number from full move number and side to move.
|
| |
| constexpr Color | colorOfPly (std::uint_fast32_t plyNum) noexcept |
| | Returns side to move for a ply number.
|
| |
| constexpr std::uint_fast32_t | moveNumOfPly (std::uint_fast32_t plyNum) noexcept |
| | Computes the full move for a ply number.
|
| |
| auto | operator<=> (const CompressedPosition_FixedLength &lhs, const CompressedPosition_FixedLength &rhs) noexcept |
| | Three-way comparison operator (spaceship). The comparison provides strong ordering.
|
| |
| bool | operator== (const CompressedPosition_FixedLength &lhs, const CompressedPosition_FixedLength &rhs) noexcept |
| | Equality comparison operator.
|
| |
| constexpr std::string_view | getVersionString () noexcept |
| |
| template<typename IteratorType , MoveGenType type, typename ParamType , Color turn> |
| auto | generateMovesForPawnsTempl (const ChessBoard &board, IteratorType i, ParamType legalDestinations) noexcept -> IteratorType |
| | Generates legal pawn moves, the actual implementation.
|
| |
| template<typename IteratorType , MoveGenType type, typename ParamType > |
| auto | generateMovesForPawns (const ChessBoard &board, IteratorType i, ParamType legalDestinations) noexcept -> IteratorType |
| | Generates legal pawn moves, dispatch for side-to-move.
|
| |
| template<typename IteratorType , MoveGenType type, typename ParamType > |
| auto | generateMovesForKnight (const ChessBoard &board, IteratorType i, Square sq, ParamType legalDestinations) noexcept -> IteratorType |
| | Generates legal knight moves.
|
| |
| template<typename IteratorType , MoveGenType type, typename ParamType , bool pinned> |
| auto | generateMovesForBishop (const ChessBoard &board, IteratorType i, Square sq, ParamType legalDestinations, MoveTypeAndPromotion typeAndPromo) noexcept -> IteratorType |
| | Generates legal bishop moves for queen or bishop.
|
| |
| template<typename IteratorType , MoveGenType type, typename ParamType , bool pinned> |
| auto | generateMovesForRook (const ChessBoard &board, IteratorType i, Square sq, ParamType legalDestinations, MoveTypeAndPromotion typeAndPromo) noexcept -> IteratorType |
| | Generates legal rook moves for queen or rook.
|
| |
| template<typename IteratorType > |
| auto | generateMovesForKing (const ChessBoard &board, IteratorType i, SquareSet attackedSquares) noexcept -> IteratorType |
| | Generates legal king moves.
|
| |
| template<typename IteratorType > |
| IteratorType | generateAllLegalMovesTemplNoCheck (const ChessBoard &board, IteratorType i) noexcept |
| | Generates all legal moves when not in check.
|
| |
| template<typename IteratorType > |
| IteratorType | generateAllLegalMovesTemplInCheck (const ChessBoard &board, IteratorType i) noexcept |
| | Generates all legal moves when in check (but not in double check)
|
| |
| template<typename IteratorType > |
| IteratorType | generateAllLegalMovesTemplInDoubleCheck (const ChessBoard &board, IteratorType i) noexcept |
| | Generates all legal moves when in double check.
|
| |
| template<MoveGenType type, typename IteratorType > |
| IteratorType | generateMovesIterTempl (const ChessBoard &board, IteratorType i) noexcept |
| | Generates all legal moves for a specific iterator type.
|
| |
| template<MoveGenType type> |
| std::size_t | generateMovesTempl (const ChessBoard &board, MoveList &moves) noexcept |
| | Generates all legal moves for a position.
|
| |
| template<MoveGenType type> |
| std::size_t | getNumberOfLegalMovesTempl (const ChessBoard &board) noexcept |
| | Returns the number of legal moves for a position.
|
| |
| template<MoveGenType type> |
| bool | hasLegalMovesTempl (const ChessBoard &board) noexcept |
| | Determines whether there are any legal moves.
|
| |
| template<MoveGenType type, typename MoveStoreFn > |
| void | generateMovesForPawnAndDestNoCaptureStoreFnTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst, typename MoveStoreFn::Store &store) noexcept |
| |
| template<MoveGenType type> |
| Move | generateSingleMoveForPawnAndDestNoCaptureTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type> |
| std::size_t | generateMovesForPawnAndDestNoCaptureTempl (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type, typename MoveStoreFn > |
| void | generateMovesForPawnAndDestCaptureStoreFnTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst, typename MoveStoreFn::Store &store) noexcept |
| |
| template<MoveGenType type> |
| Move | generateSingleMoveForPawnAndDestCaptureTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type> |
| std::size_t | generateMovesForPawnAndDestCaptureTempl (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type, typename MoveStoreFn > |
| void | generateMovesForPawnAndDestPromoNoCaptureStoreFnTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst, Piece promo, typename MoveStoreFn::Store &store) noexcept |
| |
| template<MoveGenType type> |
| Move | generateSingleMoveForPawnAndDestPromoNoCaptureTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst, Piece promo) noexcept |
| |
| template<MoveGenType type> |
| std::size_t | generateMovesForPawnAndDestPromoNoCaptureTempl (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst, Piece promo) noexcept |
| |
| template<MoveGenType type, typename MoveStoreFn > |
| void | generateMovesForPawnAndDestPromoCaptureStoreFnTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst, Piece promo, typename MoveStoreFn::Store &store) noexcept |
| |
| template<MoveGenType type> |
| Move | generateSingleMoveForPawnAndDestPromoCaptureTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst, Piece promo) noexcept |
| |
| template<MoveGenType type> |
| std::size_t | generateMovesForPawnAndDestPromoCaptureTempl (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst, Piece promo) noexcept |
| |
| template<MoveGenType type, typename MoveStoreFn > |
| void | generateMovesForKnightAndDestStoreFnTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst, typename MoveStoreFn::Store &store) noexcept |
| |
| template<MoveGenType type> |
| Move | generateSingleMoveForKnightAndDestTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type> |
| std::size_t | generateMovesForKnightAndDestTempl (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type, MoveTypeAndPromotion moveType, typename MoveStoreFn > |
| void | generateMovesForSliderAndDestStoreFnTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst, typename MoveStoreFn::Store &store) noexcept |
| |
| template<MoveGenType type> |
| Move | generateSingleMoveForBishopAndDestTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type> |
| std::size_t | generateMovesForBishopAndDestTempl (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type> |
| Move | generateSingleMoveForRookAndDestTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type> |
| std::size_t | generateMovesForRookAndDestTempl (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type> |
| Move | generateSingleMoveForQueenAndDestTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type> |
| std::size_t | generateMovesForQueenAndDestTempl (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type, typename MoveStoreFn > |
| void | generateMovesForKingAndDestStoreFnTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst, typename MoveStoreFn::Store &store) noexcept |
| |
| template<MoveGenType type> |
| Move | generateSingleMoveForKingAndDestTempl (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type> |
| std::size_t | generateMovesForKingAndDestTempl (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept |
| |
| template<MoveGenType type> |
| Move | generateSingleMoveForLongCastlingTempl (const ChessBoard &board) noexcept |
| |
| template<MoveGenType type> |
| std::size_t | generateMovesForLongCastlingTempl (const ChessBoard &board, ShortMoveList &moves) noexcept |
| |
| template<MoveGenType type> |
| Move | generateSingleMoveForShortCastlingTempl (const ChessBoard &board) noexcept |
| |
| template<MoveGenType type> |
| std::size_t | generateMovesForShortCastlingTempl (const ChessBoard &board, ShortMoveList &moves) noexcept |
| |
| constexpr MoveTypeAndPromotion | pieceToTypeAndPromotion (Piece promotion) noexcept |
| |
| template<MoveGenType type> |
| SquareSet | blocksAllChecksMaskTempl (Square kingSq, SquareSet checkers, Square dst) noexcept |
| |
| template<> |
| constexpr SquareSet | blocksAllChecksMaskTempl< MoveGenType::NO_CHECK > (Square kingSq, SquareSet checkers, Square dst) noexcept |
| |
| template<> |
| SquareSet | blocksAllChecksMaskTempl< MoveGenType::CHECK > (Square kingSq, SquareSet checkers, Square dst) noexcept |
| |
| template<MoveGenType type, typename MoveStoreFn , bool shortCastling> |
| void | generateMovesForCastlingStoreFnTempl (const ChessBoard &board, SquareSet attackedSquares, typename MoveStoreFn::Store &store) noexcept |
| | Generates the legal castling move, if any.
|
| |
| template<typename U64Type > |
| const U64Type & | turnSpecificLookup (const std::array< U64Type, 2U > &array, Color turn) noexcept |
| | Piece attack tables.
|
| |
| template<typename U64Type , std::size_t N> |
| const U64Type & | turnSpecificArrayLookup (const std::array< std::array< U64Type, 2U >, N > &array, std::size_t i, Color turn) noexcept |
| | Optimized lookup for arrays indexed by general index and turn (side-to-move).
|
| |
| constexpr std::uint32_t | pgnScannerTokenToMaskBit (PgnScannerToken token) noexcept |
| |