17#ifndef HOOVER_CHESS_UTILS__PGN_READER__CHESSBOARD_H_INCLUDED
18#define HOOVER_CHESS_UTILS__PGN_READER__CHESSBOARD_H_INCLUDED
34struct MoveGenFunctions;
35class MoveGenFunctionTables;
219 assert(mask <= 0x0FU);
220 return std::uint_fast16_t(mask) << 6U;
225 constexpr Move() noexcept = default;
240 (static_cast<std::uint16_t>(src)) |
241 (static_cast<std::uint16_t>(typeAndPromo) << 6) |
242 (static_cast<std::uint16_t>(dst) << 10U)
258 Move &operator = (const
Move &) noexcept = default;
374 static_assert(std::is_same_v<UnderlyingType, PieceUnderlyingType>);
376 constexpr UnderlyingType bias =
387 (
static_cast<UnderlyingType
>(
Piece::ROOK) + bias) ==
487 assert(m.getEncodedValue() <= 0xFFFFU);
500 m_encoded { m.getEncodedValue() }
650 Square whiteLongCastleRook,
Square whiteShortCastleRook,
651 Square blackLongCastleRook,
Square blackShortCastleRook,
653 std::uint_fast8_t halfMoveClock, std::uint_fast32_t plyNum);
699 Square whiteLongCastleRook,
Square whiteShortCastleRook,
700 Square blackLongCastleRook,
Square blackShortCastleRook,
702 std::uint_fast8_t halfMoveClock, std::uint_fast32_t plyNum);
811 const std::uint_fast64_t flipBits {
getTurn() ==
Color::WHITE ? UINT64_C(0) : ~UINT64_C(0) };
821 const std::uint_fast64_t flipBits {
getTurn() ==
Color::WHITE ? ~UINT64_C(0) : UINT64_C(0) };
1099 return Color {
static_cast<std::uint_fast8_t
>((
m_plyNum & 1U) * 8U) };
1452 static_assert(
static_cast<std::size_t
>(
Color::WHITE) == 0U);
1453 static_assert(
static_cast<std::size_t
>(
Color::BLACK) == 8U);
1458 return (
static_cast<std::size_t
>(c) / 4U) +
static_cast<std::size_t
>(shortCastling);
1727 return m_moveGenFns->generateSingleMoveForPawnAndDestNoCapture(*
this, srcSqMask, dst);
1732 return m_moveGenFns->generateSingleMoveForPawnAndDestCapture(*
this, srcSqMask, dst);
1737 return m_moveGenFns->generateSingleMoveForPawnAndDestPromoNoCapture(*
this, srcSqMask, dst, promo);
1742 return m_moveGenFns->generateSingleMoveForPawnAndDestPromoCapture(*
this, srcSqMask, dst, promo);
1747 return m_moveGenFns->generateSingleMoveForKnightAndDest(*
this, srcSqMask, dst);
1752 return m_moveGenFns->generateSingleMoveForBishopAndDest(*
this, srcSqMask, dst);
1757 return m_moveGenFns->generateSingleMoveForRookAndDest(*
this, srcSqMask, dst);
1762 return m_moveGenFns->generateSingleMoveForQueenAndDest(*
this, srcSqMask, dst);
1767 return m_moveGenFns->generateSingleMoveForKingAndDest(*
this, srcSqMask, dst);
1782 return m_moveGenFns->generateMovesForPawnAndDestNoCapture(*
this, moves, srcSqMask, dst);
1787 return m_moveGenFns->generateMovesForPawnAndDestCapture(*
this, moves, srcSqMask, dst);
1792 return m_moveGenFns->generateMovesForPawnAndDestPromoNoCapture(*
this, moves, srcSqMask, dst, promo);
1797 return m_moveGenFns->generateMovesForPawnAndDestPromoCapture(*
this, moves, srcSqMask, dst, promo);
1802 return m_moveGenFns->generateMovesForKnightAndDest(*
this, moves, srcSqMask, dst);
1807 return m_moveGenFns->generateMovesForBishopAndDest(*
this, moves, srcSqMask, dst);
1812 return m_moveGenFns->generateMovesForRookAndDest(*
this, moves, srcSqMask, dst);
1817 return m_moveGenFns->generateMovesForQueenAndDest(*
this, moves, srcSqMask, dst);
1822 return m_moveGenFns->generateMovesForKingAndDest(*
this, moves, srcSqMask, dst);
1827 return m_moveGenFns->generateMovesForShortCastling(*
this, moves);
1832 return m_moveGenFns->generateMovesForLongCastling(*
this, moves);
1837 return m_moveGenFns->generateMoves(*
this, moves);
1860 return PositionStatus {
static_cast<std::uint_fast8_t
>(noLegalMoves * 2U + inCheck) };
The chessboard.
Definition chessboard.h:589
Square getCastlingRook(Color c, bool shortCastling) const noexcept
Returns castling rook square if castling rights apply or Square::NONE if no castling rights.
Definition chessboard.h:1049
bool isInCheck() const noexcept
Returns whether the king is in check.
Definition chessboard.h:918
SquareSet getBishopsAndQueens() const noexcept
Returns squares occupied by bishops and queens (diagonal sliders)
Definition chessboard.h:878
Move generateSingleMoveForShortCastling() const noexcept
Generates a legal short castling move.
Definition chessboard.h:1770
void printBoard() const
Prints the current board to stdout. This is intended only for debugging purposes.
Square getEpSquare() const noexcept
Returns the en-passant square or Square::NONE if en-passant capture is not possible.
Definition chessboard.h:1069
bool hasLegalMoves() const noexcept
Determines whether any legal moves as available in the current position.
Definition chessboard.h:1845
void loadFEN(std::string_view fen)
Sets the board from FEN.
std::size_t generateMovesForKnightAndDest(ShortMoveList &moves, SquareSet srcSqMask, Square dst) const noexcept
Generates a list of legal knight moves with a known destination square. May be capturing.
Definition chessboard.h:1800
SquareSet m_rooks
Rooks and queens.
Definition chessboard.h:1374
SquareSet getKnights() const noexcept
Returns squares occupied by knights.
Definition chessboard.h:846
std::size_t generateMovesForQueenAndDest(ShortMoveList &moves, SquareSet srcSqMask, Square dst) const noexcept
Generates a list of legal queen moves with a known destination square. May be capturing.
Definition chessboard.h:1815
SquareSet getBlackPieces() const noexcept
Returns squares occupied by white pieces (including pawns).
Definition chessboard.h:819
void doMove(Move m) noexcept
Applies a move on the current position. The move is assumed to be legal, and it must be from one of t...
Move generateSingleMoveForPawnAndDestNoCapture(SquareSet srcSqMask, Square dst) const noexcept
Generates a legal non-promoting, non-capturing pawn move with a known destination square.
Definition chessboard.h:1725
SquareSet m_bishops
Bishops and queens.
Definition chessboard.h:1366
std::size_t generateMovesForLongCastling(ShortMoveList &moves) const noexcept
Generates the long castling move in a list, if legal.
Definition chessboard.h:1830
Square getWhiteLongCastleRook() const noexcept
Shorthand for getCastlingRook(Color::WHITE, false).
Definition chessboard.h:1010
Move generateSingleMoveForKingAndDest(SquareSet srcSqMask, Square dst) const noexcept
Generates a legal king move with a known destination square. May be capturing.
Definition chessboard.h:1765
std::uint8_t m_halfMoveClock
Current half move clock.
Definition chessboard.h:1402
Square getWhiteShortCastleRook() const noexcept
Shorthand for getCastlingRook(Color::WHITE, true).
Definition chessboard.h:1019
void calculateMasks(const ArrayBoard &board) noexcept
Calculates bitboard masks for an ArrayBoard object.
Square m_oppKingSq
King in not turn.
Definition chessboard.h:1412
Square getKingInTurn() const noexcept
Returns the square of the king in turn.
Definition chessboard.h:902
void updateCheckersAndPins() noexcept
Determines checkers and pinned pieces.
std::size_t generateMovesForPawnAndDestCapture(ShortMoveList &moves, SquareSet srcSqMask, Square dst) const noexcept
Generates a list of legal non-promoting, capturing pawn moves with a known destination square.
Definition chessboard.h:1785
Move generateSingleMoveForRookAndDest(SquareSet srcSqMask, Square dst) const noexcept
Generates a legal rook move with a known destination square. May be capturing.
Definition chessboard.h:1755
SquareSet getPawns() const noexcept
Returns squares occupied by pawns.
Definition chessboard.h:838
SquareSet m_pawns
Pawns.
Definition chessboard.h:1349
SquareSet getBishops() const noexcept
Returns squares occupied by bishops.
Definition chessboard.h:854
SquareSet getKings() const noexcept
Returns squares occupied by kings.
Definition chessboard.h:894
SquareSet getPinnedPieces() const noexcept
Returns squares occupied by absolutely pinned pieces.
Definition chessboard.h:1001
const MoveGenFunctions * m_moveGenFns
Move generator functions for this position.
Definition chessboard.h:1392
Move generateSingleMoveForQueenAndDest(SquareSet srcSqMask, Square dst) const noexcept
Generates a legal queen move with a known destination square. May be capturing.
Definition chessboard.h:1760
std::size_t getNumberOfLegalMoves() const noexcept
Returns the number of legal moves for the current position. This function is mostly useful for calcul...
Definition chessboard.h:1840
SquareSet m_turnColorMask
Occupied squares that have the same color piece as getTurn()
Definition chessboard.h:1344
SquareSet getQueens() const noexcept
Returns squares occupied by queens.
Definition chessboard.h:870
void setBoard(const ArrayBoard &board, Square whiteLongCastleRook, Square whiteShortCastleRook, Square blackLongCastleRook, Square blackShortCastleRook, Square epSquare, std::uint_fast8_t halfMoveClock, std::uint_fast32_t plyNum)
Sets the board from an array board (aka Mailbox)
Square m_epSquare
En-passant square.
Definition chessboard.h:1417
SquareSet getRooksAndQueens() const noexcept
Returns squares occupied by rooks and queens (horizontal/vertical sliders)
Definition chessboard.h:886
std::size_t generateMovesForKingAndDest(ShortMoveList &moves, SquareSet srcSqMask, Square dst) const noexcept
Generates a list of legal king moves with a known destination square. May be capturing.
Definition chessboard.h:1820
static constexpr std::size_t getCastlingRookIndex(Color c, bool shortCastling) noexcept
Returns the array index for a castling rook.
Definition chessboard.h:1450
SquareSet getWhitePieces() const noexcept
Returns squares occupied by white pieces (including pawns).
Definition chessboard.h:809
std::size_t generateMovesForShortCastling(ShortMoveList &moves) const noexcept
Generates the short castling move in a list, if legal.
Definition chessboard.h:1825
Move generateSingleMoveForLongCastling() const noexcept
Generates a legal long castling move.
Definition chessboard.h:1775
std::uint_fast8_t getHalfMoveClock() const noexcept
Current half-move clock.
Definition chessboard.h:1078
std::size_t generateMovesForRookAndDest(ShortMoveList &moves, SquareSet srcSqMask, Square dst) const noexcept
Generates a list of legal rook moves with a known destination square. May be capturing.
Definition chessboard.h:1810
Square & getCastlingRookRef(Color c, bool shortCastling) noexcept
Gets a reference to the castling rights rook for direct read/write access.
Definition chessboard.h:1476
void validateBoard()
Validates the board for items that are common for both setBoard() and loadFEN() and sets m_checkers.
Move generateSingleMoveForKnightAndDest(SquareSet srcSqMask, Square dst) const noexcept
Generates a legal knight move with a known destination square. May be capturing.
Definition chessboard.h:1745
void setCastlingRook(Color c, bool shortCastling, Square sq) noexcept
Sets/resets castling rights and the associated rook.
Definition chessboard.h:1466
void getArrayBoard(ArrayBoard &out_board) const noexcept
Extracts the current position as an ArrayBoard.
std::size_t generateMovesForPawnAndDestNoCapture(ShortMoveList &moves, SquareSet srcSqMask, Square dst) const noexcept
Generates a list of legal non-promoting, non-capturing pawn moves with a known destination square.
Definition chessboard.h:1780
Square m_kingSq
King in turn.
Definition chessboard.h:1407
SquareSet getOccupancyMask() const noexcept
Returns squares that are occupied by pieces (including pawns).
Definition chessboard.h:801
Move generateSingleMoveForPawnAndDestCapture(SquareSet srcSqMask, Square dst) const noexcept
Generates a legal non-promoting, capturing pawn move with a known destination square.
Definition chessboard.h:1730
std::uint32_t m_plyNum
Current ply number.
Definition chessboard.h:1397
SquareSet getRooks() const noexcept
Returns squares occupied by rooks.
Definition chessboard.h:862
Move generateSingleMoveForBishopAndDest(SquareSet srcSqMask, Square dst) const noexcept
Generates a legal bishop move with a known destination square. May be capturing.
Definition chessboard.h:1750
SquareSet m_occupancyMask
Bit board of occupied squares.
Definition chessboard.h:1339
std::size_t generateMovesForPawnAndDestPromoNoCapture(ShortMoveList &moves, SquareSet srcSqMask, Square dst, Piece promo) const noexcept
Generates a list of legal promoting, non-capturing pawn moves with a known destination square.
Definition chessboard.h:1790
std::array< Square, 4U > m_castlingRooks
Castling rooks.
Definition chessboard.h:1430
PieceAndColor getSquarePiece(Square sq) const noexcept
Returns the piece and color on a specified square.
Move generateSingleMoveForPawnAndDestPromoNoCapture(SquareSet srcSqMask, Square dst, Piece promo) const noexcept
Generates a legal promoting, non-capturing pawn move with a known destination square.
Definition chessboard.h:1735
Color getTurn() const noexcept
Returns side to move.
Definition chessboard.h:1097
void loadStartPos() noexcept
Loads the starting position.
Definition chessboard.h:771
SquareSet getCheckers() const noexcept
Returns squares occupied by checkers.
Definition chessboard.h:926
Square getBlackShortCastleRook() const noexcept
Shorthand for getCastlingRook(Color::BLACK, true).
Definition chessboard.h:1037
std::uint_fast32_t getCurrentPlyNum() const noexcept
Full move counter in plies.
Definition chessboard.h:1089
PositionStatus determineStatus() const noexcept
Determines the status of the position.
Definition chessboard.h:1850
SquareSet m_checkers
Squares where there is a checker.
Definition chessboard.h:1382
std::size_t generateMovesForBishopAndDest(ShortMoveList &moves, SquareSet srcSqMask, Square dst) const noexcept
Generates a list of legal bishop moves with a known destination square. May be capturing.
Definition chessboard.h:1805
ChessBoard() noexcept
Constructor (default)
SquareSet m_knights
Knights.
Definition chessboard.h:1354
Piece getSquarePieceNoColor(Square sq) const noexcept
Returns the piece on a specified square.
Square getBlackLongCastleRook() const noexcept
Shorthand for getCastlingRook(Color::BLACK, false).
Definition chessboard.h:1028
Move generateSingleMoveForPawnAndDestPromoCapture(SquareSet srcSqMask, Square dst, Piece promo) const noexcept
Generates a legal promoting, capturing pawn move with a known destination square.
Definition chessboard.h:1740
SquareSet getPiecesInTurn() const noexcept
Returns squares that are occupied by pieces (including pawns) that belong to the side to move.
Definition chessboard.h:830
std::size_t generateMovesForPawnAndDestPromoCapture(ShortMoveList &moves, SquareSet srcSqMask, Square dst, Piece promo) const noexcept
Generates a list of legal promoting, capturing pawn moves with a known destination square.
Definition chessboard.h:1795
SquareSet m_kings
Kings.
Definition chessboard.h:1361
SquareSet m_pinnedPieces
Squares with pinned pieces.
Definition chessboard.h:1387
Square getKingNotInTurn() const noexcept
Returns the square of the king not in turn.
Definition chessboard.h:910
std::size_t generateMoves(MoveList &moves) const noexcept
Generates a list of all legal moves for the current position.
Definition chessboard.h:1835
Compact representation of Move
Definition chessboard.h:446
~CompactMove()=default
Default destructor.
CompactMove & operator=(const CompactMove &) &=default
Default copy assignment.
CompactMove(CompactMove &&)=default
Default move constructor.
std::uint16_t m_encoded
Encoded move.
Definition chessboard.h:462
constexpr std::uint16_t getEncodedValue() const noexcept
Returns raw encoded value. Usually only used in debugging.
Definition chessboard.h:493
CompactMove(const CompactMove &)=default
Default copy constructor.
constexpr CompactMove(const Move &m) noexcept
Constructs a compact move from Move
Definition chessboard.h:484
CompactMove()=default
Default constructor (null move)
A legal move. Important: see the note!
Definition chessboard.h:198
static constexpr Move illegalNoMove() noexcept
Token for illegal move: no moves generated.
Definition chessboard.h:429
constexpr Square getSrc() const noexcept
Returns move source square.
Definition chessboard.h:275
constexpr MoveTypeAndPromotion getTypeAndPromotion() const noexcept
Returns move type and promotion piece.
Definition chessboard.h:290
constexpr Move(const Move &) noexcept=default
Constructor (copy)
constexpr Piece getPromotionPiece() const noexcept
Returns promotion piece of a promotion move.
Definition chessboard.h:369
static constexpr Move illegalAmbiguousMove() noexcept
Token for illegal move: ambiguous move generation.
Definition chessboard.h:437
constexpr std::uint_fast16_t getEncodedValue() const noexcept
Returns raw encoded value. Usually only used in debugging.
Definition chessboard.h:412
constexpr bool operator==(const Move &o) const noexcept
Comparator (equality)
Definition chessboard.h:421
std::uint_fast16_t m_encoded
Encoded move.
Definition chessboard.h:214
constexpr bool isEnPassantMove() const noexcept
Checks whether the move type is en-passant pawn capture.
Definition chessboard.h:327
constexpr Move() noexcept=default
Default constructor (null move)
constexpr bool isRegularMove() const noexcept
Checks whether a move type is regular.
Definition chessboard.h:306
constexpr Square getDst() const noexcept
Returns move destination square.
Definition chessboard.h:284
constexpr bool isIllegal() const noexcept
Checks whether the move type is illegal.
Definition chessboard.h:402
constexpr Move(Move &&) noexcept=default
Constructor (move)
constexpr bool isCastlingMove() const noexcept
Checks whether a move type is a castling move.
Definition chessboard.h:359
static constexpr std::uint_fast16_t getMoveTypeAndPromotionMask(MoveTypeAndPromotionUnderlyingType mask) noexcept
Definition chessboard.h:216
constexpr bool isPromotionMove() const noexcept
Checks whether the move type is a pawn promotion.
Definition chessboard.h:341
Set of squares. Implemented using a bit-mask.
Definition chessboard-types-squareset.h:35
static constexpr SquareSet square(Square sq) noexcept
Returns a set of single square.
Definition chessboard-types-squareset.h:497
static constexpr SquareSet row(RowColumn row) noexcept
Returns a set of squares in row number row.
Definition chessboard-types-squareset.h:485
static constexpr SquareSet none() noexcept
Returns an empty set.
Definition chessboard-types-squareset.h:452
std::array< CompactMove, 256U > MoveList
Move list returned by ChessBoard::generateMoves().
Definition chessboard.h:508
MoveTypeAndPromotion
Move type (4 bits, range: 0..15)
Definition chessboard.h:91
constexpr bool isValidSquare(Square sq) noexcept
Checks whether a value is a square.
Definition chessboard-types.h:306
std::array< PieceAndColorCompact, 64U > ArrayBoard
Board representation using an array.
Definition chessboard.h:47
PieceAndColor
Named piece and color.
Definition chessboard-types.h:219
Piece
Named piece.
Definition chessboard-types.h:204
std::array< CompactMove, 8U > ShortMoveList
Short move list returned by move generators for writing a SAN move. That is, when the piece type and ...
Definition chessboard.h:514
Color
Color of a piece or side to move.
Definition chessboard-types.h:194
Square
Named square.
Definition chessboard-types.h:122
std::uint_fast8_t PieceUnderlyingType
Underlying type of Piece
Definition chessboard-types.h:56
PositionStatus
Status of a position.
Definition chessboard-types.h:276
@ PROMO_ROOK
Pawn promotion to rook.
@ ILLEGAL
Illegal move type.
@ PROMO_QUEEN
Pawn promotion to queen.
@ REGULAR_BISHOP_MOVE
Bishop move.
@ REGULAR_KNIGHT_MOVE
Knight move.
@ PROMO_BISHOP
Pawn promotion to bishop.
@ CASTLING_SHORT
Short castling.
@ EN_PASSANT
Pawn en-passant capture.
@ REGULAR_ROOK_MOVE
Rook move.
@ PROMO_KNIGHT
Pawn promotion to knight.
@ REGULAR_KING_MOVE
King move (not castling)
@ REGULAR_PAWN_MOVE
Regular non-capturing or capturing move (no promotion or en passant)
@ REGULAR_QUEEN_MOVE
Queen move.
@ CASTLING_LONG
Long castling.
@ BLACK
Black piece or black side to move.
@ WHITE
White piece or white side to move.
@ NONE
Token for 'no' square.
@ NORMAL
Regular position (not in check, mate, or stalemate)
@ CHECK
King is checked (but not mated)
MoveGenType
Move generator type.
Definition chessboard.h:519
@ NO_CHECK
Move generator for when the king is not in check. All moves are considered.
@ DOUBLE_CHECK
Move generator for when the king is in double check. Only king moves are considered.
Definition chessboard-types-squareset.h:30
std::uint_fast8_t MoveTypeAndPromotionUnderlyingType
Underlying type of MoveTypeAndPromotion
Definition chessboard.h:81
Board representation using SquareSets (bit boards)
Definition chessboard.h:57
SquareSet bishops
Bishop squares.
Definition chessboard.h:65
SquareSet rooks
Rook squares.
Definition chessboard.h:68
SquareSet queens
Queen squares.
Definition chessboard.h:71
SquareSet kings
King squares.
Definition chessboard.h:74
SquareSet whitePieces
Squares of white pieces. Square of black pieces are implied.
Definition chessboard.h:77
SquareSet knights
Knight squares.
Definition chessboard.h:62
SquareSet pawns
Pawn squares.
Definition chessboard.h:59
Move generator functions.
Definition chessboard.h:1490
std::size_t(* generateMoves)(const ChessBoard &board, MoveList &moves) noexcept
Generates a list of all legal moves for the current position.
Definition chessboard.h:1705
Move(* generateSingleMoveForPawnAndDestPromoCapture)(const ChessBoard &board, SquareSet srcSqMask, Square dst, Piece promo) noexcept
Generates a legal promoting, capturing pawn move with a known destination square.
Definition chessboard.h:1531
Move(* generateSingleMoveForRookAndDest)(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
Generates a legal rook move with a known destination square. May be capturing.
Definition chessboard.h:1561
std::size_t(* getNumberOfLegalMoves)(const ChessBoard &board) noexcept
Returns the number of legal moves for the current position. This function is mostly useful for calcul...
Definition chessboard.h:1715
std::size_t(* generateMovesForPawnAndDestCapture)(const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
Generates a list of legal non-promoting, capturing pawn moves with a known destination square.
Definition chessboard.h:1613
std::size_t(* generateMovesForPawnAndDestNoCapture)(const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
Generates a list of legal non-promoting, non-capturing pawn moves with a known destination square.
Definition chessboard.h:1603
Move(* generateSingleMoveForPawnAndDestCapture)(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
Generates a legal non-promoting, capturing pawn move with a known destination square.
Definition chessboard.h:1509
Move(* generateSingleMoveForBishopAndDest)(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
Generates a legal bishop move with a known destination square. May be capturing.
Definition chessboard.h:1551
std::size_t(* generateMovesForRookAndDest)(const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
Generates a list of legal rook moves with a known destination square. May be capturing.
Definition chessboard.h:1665
std::size_t(* generateMovesForKingAndDest)(const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
Generates a list of legal king moves with a known destination square. May be capturing.
Definition chessboard.h:1685
Move(* generateSingleMoveForShortCastling)(const ChessBoard &board) noexcept
Generates a legal short castling move.
Definition chessboard.h:1587
std::size_t(* generateMovesForBishopAndDest)(const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
Generates a list of legal bishop moves with a known destination square. May be capturing.
Definition chessboard.h:1655
std::size_t(* generateMovesForKnightAndDest)(const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
Generates a list of legal knight moves with a known destination square. May be capturing.
Definition chessboard.h:1645
bool(* hasLegalMoves)(const ChessBoard &board) noexcept
Determines whether there are any legal moves function is mostly useful for calculating the moves in p...
Definition chessboard.h:1722
Move(* generateSingleMoveForPawnAndDestNoCapture)(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
Generates a legal non-promoting, non-capturing pawn move with a known destination square.
Definition chessboard.h:1499
std::size_t(* generateMovesForLongCastling)(const ChessBoard &board, ShortMoveList &moves) noexcept
Generates the long castling move in a list, if legal.
Definition chessboard.h:1699
std::size_t(* generateMovesForShortCastling)(const ChessBoard &board, ShortMoveList &moves) noexcept
Generates the short castling move in a list, if legal.
Definition chessboard.h:1692
std::size_t(* generateMovesForPawnAndDestPromoCapture)(const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst, Piece promo) noexcept
Generates a list of legal promoting, capturing pawn moves with a known destination square.
Definition chessboard.h:1635
Move(* generateSingleMoveForKnightAndDest)(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
Generates a legal knight move with a known destination square. May be capturing.
Definition chessboard.h:1541
Move(* generateSingleMoveForPawnAndDestPromoNoCapture)(const ChessBoard &board, SquareSet srcSqMask, Square dst, Piece promo) noexcept
Generates a legal promoting, non-capturing pawn move with a known destination square.
Definition chessboard.h:1520
std::size_t(* generateMovesForPawnAndDestPromoNoCapture)(const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst, Piece promo) noexcept
Generates a list of legal promoting, non-capturing pawn moves with a known destination square.
Definition chessboard.h:1624
Move(* generateSingleMoveForQueenAndDest)(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
Generates a legal queen move with a known destination square. May be capturing.
Definition chessboard.h:1571
Move(* generateSingleMoveForLongCastling)(const ChessBoard &board) noexcept
Generates a legal long castling move.
Definition chessboard.h:1593
std::size_t(* generateMovesForQueenAndDest)(const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
Generates a list of legal queen moves with a known destination square. May be capturing.
Definition chessboard.h:1675
Move(* generateSingleMoveForKingAndDest)(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
Generates a legal king move with a known destination square. May be capturing.
Definition chessboard.h:1581