|
BenBot 1.7.5
A chess engine
|
#include <libchess/moves/Move.hpp>
Public Member Functions | |
| constexpr | Move ()=default |
| constexpr | Move (Square start, Square end, PieceType type, MaybePieceType promotedType=std::nullopt) |
| constexpr auto | from () const noexcept -> Square |
| constexpr auto | hash () const noexcept -> size_t |
| constexpr auto | is_castling () const noexcept -> bool |
| auto | is_null () const noexcept -> bool |
| constexpr auto | is_promotion () const noexcept -> bool |
| constexpr auto | is_under_promotion () const noexcept -> bool |
| constexpr auto | operator== (const Move &) const noexcept -> bool=default |
| constexpr auto | piece () const noexcept -> PieceType |
| constexpr auto | promoted_type () const noexcept -> MaybePieceType |
| constexpr auto | to () const noexcept -> Square |
Related Symbols | |
(Note that these are not member symbols.) | |
| constexpr auto | operator<=> (const Move &first, const Move &second) noexcept -> std::strong_ordering |
| constexpr auto | castle_kingside (Color color) noexcept -> Move |
| constexpr auto | castle_queenside (Color color) noexcept -> Move |
| constexpr auto | promotion (File file, Color color, PieceType promotedType=PieceType::Queen) noexcept -> Move |
This struct encodes information about a move.
Moves are encoded as a starting and ending square, as well as a piece type.
Castling is considered a king move.
En passant cannot be identified solely using the information in this struct; based on the starting and ending squares of the capturing pawn, an en passant capture appears just like any other pawn capture.
This struct also does not directly identify if the move is a capture.
Null moves are supported; a null move essentially indicates swapping the side to move and incrementing the halfmove counter without changing any piece positions.
|
constexprdefault |
Creates a null move.
|
constexpr |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
|
inlinenodiscardnoexcept |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
|
constexprdefaultnoexcept |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |
|
nodiscardconstexprnoexcept |