|
HooverChessUtils_PgnReader 0.9.0
|
A position encoded in 192 bits. More...
#include <position-compress-fixed.h>
Public Attributes | |
| std::uint64_t | occupancy |
| Occupancy mask. | |
| std::array< std::uint32_t, 4U > | dataPlanes |
| Data planes. | |
A position encoded in 192 bits.
The encoding scheme is as follows:
occupancy determines the squares that are occupied, same encoding as SquareSet. All other squares are empty.CompressedPosition_PieceEncoding).value = BIT_N(dataPlanes[0]) + 2*BIT_N(dataPlanes[1]) + 4*BIT_N(dataPlanes[2]) + 8*BIT_N(dataPlanes[3])Properties of the position other than the piece configuration are encoded as follows:
| Property | Encoding |
|---|---|
| Side to move | Encoded in the white king: CompressedPosition_PieceEncoding::WHITE_KING_IN_TURN or CompressedPosition_PieceEncoding::WHITE_KING_NOT_IN_TURN. |
| Castling rights | Encoded in the rooks: CompressedPosition_PieceEncoding::WHITE_ROOK_CANNOT_CASTLE, CompressedPosition_PieceEncoding::WHITE_ROOK_CAN_CASTLE, CompressedPosition_PieceEncoding::BLACK_ROOK_CANNOT_CASTLE, CompressedPosition_PieceEncoding::BLACK_ROOK_CAN_CASTLE. |
| En passant square | Encoded as the en passant capturable pawn: CompressedPosition_PieceEncoding::EP_PAWN. The color of the en passant capturable pawn is the opposite of the side to move. The en passant square is inferred from the en passant capturable pawn position (retreat by 1 square). |
The usual chess position restrictions apply:
CompressedPosition_PieceEncoding::WHITE_KING_IN_TURN or CompressedPosition_PieceEncoding::WHITE_KING_NOT_IN_TURN.CompressedPosition_PieceEncoding::WHITE_ROOK_CAN_CASTLE may be present only on the 1st rank.CompressedPosition_PieceEncoding::BLACK_ROOK_CAN_CASTLE may be present only on the 8th rank.CompressedPosition_PieceEncoding::WHITE_ROOK_CAN_CASTLE is present, then white king must be on the 1st rankCompressedPosition_PieceEncoding::BLACK_ROOK_CAN_CASTLE is present, then black king must be on the 8th rankChessBoard. | std::array<std::uint32_t, 4U> hoover_chess_utils::pgn_reader::CompressedPosition_FixedLength::dataPlanes |
Data planes.
| std::uint64_t hoover_chess_utils::pgn_reader::CompressedPosition_FixedLength::occupancy |
Occupancy mask.
SquareSet