HooverChessUtils_PgnReader 0.9.0
Loading...
Searching...
No Matches
Public Attributes | List of all members
hoover_chess_utils::pgn_reader::MoveGenFunctions Struct Reference

Move generator functions. More...

#include <chessboard.h>

Collaboration diagram for hoover_chess_utils::pgn_reader::MoveGenFunctions:
Collaboration graph
[legend]

Public Attributes

Move(* generateSingleMoveForPawnAndDestNoCapture )(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
 Generates a legal non-promoting, non-capturing pawn move with a known destination square.
 
Move(* generateSingleMoveForPawnAndDestCapture )(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
 Generates a legal non-promoting, capturing pawn move with a known destination square.
 
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.
 
Move(* generateSingleMoveForPawnAndDestPromoCapture )(const ChessBoard &board, SquareSet srcSqMask, Square dst, Piece promo) noexcept
 Generates a legal promoting, capturing pawn move with a known destination square.
 
Move(* generateSingleMoveForKnightAndDest )(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
 Generates a legal knight move with a known destination square. May be capturing.
 
Move(* generateSingleMoveForBishopAndDest )(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
 Generates a legal bishop move with a known destination square. May be capturing.
 
Move(* generateSingleMoveForRookAndDest )(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
 Generates a legal rook move with a known destination square. May be capturing.
 
Move(* generateSingleMoveForQueenAndDest )(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
 Generates a legal queen move with a known destination square. May be capturing.
 
Move(* generateSingleMoveForKingAndDest )(const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
 Generates a legal king move with a known destination square. May be capturing.
 
Move(* generateSingleMoveForShortCastling )(const ChessBoard &board) noexcept
 Generates a legal short castling move.
 
Move(* generateSingleMoveForLongCastling )(const ChessBoard &board) noexcept
 Generates a legal long castling move.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
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.
 
std::size_t(* generateMovesForShortCastling )(const ChessBoard &board, ShortMoveList &moves) noexcept
 Generates the short castling move in a list, if legal.
 
std::size_t(* generateMovesForLongCastling )(const ChessBoard &board, ShortMoveList &moves) noexcept
 Generates the long castling move in a list, if legal.
 
std::size_t(* generateMoves )(const ChessBoard &board, MoveList &moves) noexcept
 Generates a list of all legal moves for the current position.
 
std::size_t(* getNumberOfLegalMoves )(const ChessBoard &board) noexcept
 Returns the number of legal moves for the current position. This function is mostly useful for calculating the moves in perft leaf positions.
 
bool(* hasLegalMoves )(const ChessBoard &board) noexcept
 Determines whether there are any legal moves function is mostly useful for calculating the moves in perft leaf positions.
 

Detailed Description

Move generator functions.

Member Data Documentation

◆ generateMoves

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateMoves) (const ChessBoard &board, MoveList &moves) noexcept
noexcept

Generates a list of all legal moves for the current position.

Parameters
[in]movesCaller-allocated move list
Returns
Number of moves added in the move list

◆ generateMovesForBishopAndDest

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateMovesForBishopAndDest) (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a list of legal bishop moves with a known destination square. May be capturing.

Parameters
[in]boardThe chess board
[out]movesList of returned moves
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Number of returned moves

◆ generateMovesForKingAndDest

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateMovesForKingAndDest) (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a list of legal king moves with a known destination square. May be capturing.

Parameters
[in]boardThe chess board
[out]movesList of returned moves
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Number of returned moves

◆ generateMovesForKnightAndDest

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateMovesForKnightAndDest) (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a list of legal knight moves with a known destination square. May be capturing.

Parameters
[in]boardThe chess board
[out]movesList of returned moves
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Number of returned moves

◆ generateMovesForLongCastling

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateMovesForLongCastling) (const ChessBoard &board, ShortMoveList &moves) noexcept
noexcept

Generates the long castling move in a list, if legal.

Parameters
[in]boardThe chess board
[out]movesList of returned moves
Returns
Number of returned moves

◆ generateMovesForPawnAndDestCapture

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateMovesForPawnAndDestCapture) (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a list of legal non-promoting, capturing pawn moves with a known destination square.

Parameters
[in]boardThe chess board
[out]movesList of returned moves
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Number of returned moves

◆ generateMovesForPawnAndDestNoCapture

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateMovesForPawnAndDestNoCapture) (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a list of legal non-promoting, non-capturing pawn moves with a known destination square.

Parameters
[in]boardThe chess board
[out]movesList of returned moves
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Number of returned moves

◆ generateMovesForPawnAndDestPromoCapture

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateMovesForPawnAndDestPromoCapture) (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst, Piece promo) noexcept
noexcept

Generates a list of legal promoting, capturing pawn moves with a known destination square.

Parameters
[in]boardThe chess board
[out]movesList of returned moves
[in]srcSqMaskAllowed source squares
[in]dstDestination square
[in]promoPromotion piece
Returns
Number of returned moves

◆ generateMovesForPawnAndDestPromoNoCapture

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateMovesForPawnAndDestPromoNoCapture) (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst, Piece promo) noexcept
noexcept

Generates a list of legal promoting, non-capturing pawn moves with a known destination square.

Parameters
[in]boardThe chess board
[out]movesList of returned moves
[in]srcSqMaskAllowed source squares
[in]dstDestination square
[in]promoPromotion piece
Returns
Number of returned moves

◆ generateMovesForQueenAndDest

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateMovesForQueenAndDest) (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a list of legal queen moves with a known destination square. May be capturing.

Parameters
[in]boardThe chess board
[out]movesList of returned moves
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Number of returned moves

◆ generateMovesForRookAndDest

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateMovesForRookAndDest) (const ChessBoard &board, ShortMoveList &moves, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a list of legal rook moves with a known destination square. May be capturing.

Parameters
[in]boardThe chess board
[out]movesList of returned moves
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Number of returned moves

◆ generateMovesForShortCastling

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateMovesForShortCastling) (const ChessBoard &board, ShortMoveList &moves) noexcept
noexcept

Generates the short castling move in a list, if legal.

Parameters
[in]boardThe chess board
[out]movesList of returned moves
Returns
Number of returned moves

◆ generateSingleMoveForBishopAndDest

Move(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateSingleMoveForBishopAndDest) (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a legal bishop move with a known destination square. May be capturing.

Parameters
[in]boardThe chess board
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Move. In case a move was not found or it was ambiguous, Move::isIllegal() returns true.

◆ generateSingleMoveForKingAndDest

Move(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateSingleMoveForKingAndDest) (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a legal king move with a known destination square. May be capturing.

Parameters
[in]boardThe chess board
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Move. In case a move was not found or it was ambiguous, Move::isIllegal() returns true.

◆ generateSingleMoveForKnightAndDest

Move(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateSingleMoveForKnightAndDest) (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a legal knight move with a known destination square. May be capturing.

Parameters
[in]boardThe chess board
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Move. In case a move was not found or it was ambiguous, Move::isIllegal() returns true.

◆ generateSingleMoveForLongCastling

Move(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateSingleMoveForLongCastling) (const ChessBoard &board) noexcept
noexcept

Generates a legal long castling move.

Returns
Move. In case a move was not found or it was ambiguous, Move::isIllegal() returns true.

◆ generateSingleMoveForPawnAndDestCapture

Move(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateSingleMoveForPawnAndDestCapture) (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a legal non-promoting, capturing pawn move with a known destination square.

Parameters
[in]boardThe chess board
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Move. In case a move was not found or it was ambiguous, Move::isIllegal() returns true.

◆ generateSingleMoveForPawnAndDestNoCapture

Move(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateSingleMoveForPawnAndDestNoCapture) (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a legal non-promoting, non-capturing pawn move with a known destination square.

Parameters
[in]boardThe chess board
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Move. In case a move was not found or it was ambiguous, Move::isIllegal() returns true.

◆ generateSingleMoveForPawnAndDestPromoCapture

Move(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateSingleMoveForPawnAndDestPromoCapture) (const ChessBoard &board, SquareSet srcSqMask, Square dst, Piece promo) noexcept
noexcept

Generates a legal promoting, capturing pawn move with a known destination square.

Parameters
[in]boardThe chess board
[in]srcSqMaskAllowed source squares
[in]dstDestination square
[in]promoPromotion piece
Returns
Move. In case a move was not found or it was ambiguous, Move::isIllegal() returns true.

◆ generateSingleMoveForPawnAndDestPromoNoCapture

Move(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateSingleMoveForPawnAndDestPromoNoCapture) (const ChessBoard &board, SquareSet srcSqMask, Square dst, Piece promo) noexcept
noexcept

Generates a legal promoting, non-capturing pawn move with a known destination square.

Parameters
[in]boardThe chess board
[in]srcSqMaskAllowed source squares
[in]dstDestination square
[in]promoPromotion piece
Returns
Move. In case a move was not found or it was ambiguous, Move::isIllegal() returns true.

◆ generateSingleMoveForQueenAndDest

Move(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateSingleMoveForQueenAndDest) (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a legal queen move with a known destination square. May be capturing.

Parameters
[in]boardThe chess board
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Move. In case a move was not found or it was ambiguous, Move::isIllegal() returns true.

◆ generateSingleMoveForRookAndDest

Move(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateSingleMoveForRookAndDest) (const ChessBoard &board, SquareSet srcSqMask, Square dst) noexcept
noexcept

Generates a legal rook move with a known destination square. May be capturing.

Parameters
[in]boardThe chess board
[in]srcSqMaskAllowed source squares
[in]dstDestination square
Returns
Move. In case a move was not found or it was ambiguous, Move::isIllegal() returns true.

◆ generateSingleMoveForShortCastling

Move(* hoover_chess_utils::pgn_reader::MoveGenFunctions::generateSingleMoveForShortCastling) (const ChessBoard &board) noexcept
noexcept

Generates a legal short castling move.

Returns
Move. In case a move was not found or it was ambiguous, Move::isIllegal() returns true.

◆ getNumberOfLegalMoves

std::size_t(* hoover_chess_utils::pgn_reader::MoveGenFunctions::getNumberOfLegalMoves) (const ChessBoard &board) noexcept
noexcept

Returns the number of legal moves for the current position. This function is mostly useful for calculating the moves in perft leaf positions.

Parameters
[in]boardThe chess board
Returns
Number of legal moves
See also
https://www.chessprogramming.org/Perft

◆ hasLegalMoves

bool(* hoover_chess_utils::pgn_reader::MoveGenFunctions::hasLegalMoves) (const ChessBoard &board) noexcept
noexcept

Determines whether there are any legal moves function is mostly useful for calculating the moves in perft leaf positions.

Returns
Whether legal moves exist

The documentation for this struct was generated from the following file: