17#ifndef HOOVER_CHESS_UTILS__PGN_READER__CHESSBOARD_TYPES_H_INCLUDED
18#define HOOVER_CHESS_UTILS__PGN_READER__CHESSBOARD_TYPES_H_INCLUDED
321 [[assume(row <= 7U)]];
322 [[assume(col <= 7U)]];
324 return Square((row * 8U) + col);
360 assert(index <= 63U);
361 [[assume(index <= 63U)]];
377 return static_cast<std::size_t
>(sq);
std::uint_fast8_t PieceAndColorUnderlyingType
Underlying type of PieceAndColor
Definition chessboard-types.h:65
constexpr PieceAndColorCompact toCompactType(PieceAndColor pc) noexcept
Converts PieceAndColor (fast type) to PieceAndColorCompact (compact type).
Definition chessboard-types.h:478
std::uint8_t ColorCompactType
Compact type for Color. The compact type can store all legal enumeration values.
Definition chessboard-types.h:51
constexpr bool isValidSquare(Square sq) noexcept
Checks whether a value is a square.
Definition chessboard-types.h:306
constexpr RowColumn rowOf(Square sq) noexcept
Returns row number of square.
Definition chessboard-types.h:343
constexpr Color oppositeColor(Color c) noexcept
Flips the color.
Definition chessboard-types.h:409
std::uint_fast8_t ColorUnderlyingType
Underlying type of Color
Definition chessboard-types.h:47
std::uint_fast8_t SquareUnderlyingType
Underlying type of Square
Definition chessboard-types.h:38
constexpr Square addToSquareNoOverflowCheck(Square sq, std::int_fast8_t shift) noexcept
Adds to square. This function performs no overflow checking.
Definition chessboard-types.h:390
constexpr Piece pieceOf(PieceAndColor pc) noexcept
Returns piece of a piece and color enumeration value.
Definition chessboard-types.h:449
constexpr PieceAndColor toFastType(PieceAndColorCompact pc) noexcept
Converts PieceAndColorCompact (compact type) to PieceAndColor (fast type).
Definition chessboard-types.h:488
PieceAndColor
Named piece and color.
Definition chessboard-types.h:219
std::uint_fast8_t PositionStatusUnderlyingType
Underlying type of PositionStatus
Definition chessboard-types.h:74
constexpr std::size_t getIndexOfSquare(Square sq) noexcept
Returns an index for a square.
Definition chessboard-types.h:372
std::uint8_t PositionStatusCompactType
Compact type for PositionStatus. The compact type can store all legal enumeration values.
Definition chessboard-types.h:78
constexpr Color colorOf(PieceAndColor pc) noexcept
Returns color of a piece.
Definition chessboard-types.h:418
std::uint8_t SquareCompactType
Compact type for Square. The compact type can store all legal enumeration values.
Definition chessboard-types.h:42
std::uint8_t RowColumnCompactType
Compact type for RowColumn. The compact type can store all legal enumeration values.
Definition chessboard-types.h:87
constexpr PieceAndColor makePieceAndColor(Piece p, Color c) noexcept
Constructs a PieceAndColor enumeration value from Piece and Color.
Definition chessboard-types.h:462
Piece
Named piece.
Definition chessboard-types.h:204
PieceAndColorCompact
Named piece and color (compact representation)
Definition chessboard-types.h:248
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
std::uint_fast8_t RowColumnUnderlyingType
Underlying type of RowColumn
Definition chessboard-types.h:83
constexpr bool isValidValue(Square sq) noexcept
Checks whether a value is a valid enumeration value.
Definition chessboard-types.h:295
PositionStatus
Status of a position.
Definition chessboard-types.h:276
RowColumnUnderlyingType RowColumn
Row/column coordinate type. Valid range: [0, 7] signifying ranks 1–8 (as rows) or files A–H (as colum...
Definition chessboard-types.h:92
constexpr RowColumn columnOf(Square sq) noexcept
Returns column number of square.
Definition chessboard-types.h:331
constexpr Square makeSquare(RowColumn col, RowColumn row) noexcept
Constructs a square from column and row.
Definition chessboard-types.h:316
std::uint8_t PieceCompactType
Compact type for Piece. The compact type can store all legal enumeration values.
Definition chessboard-types.h:60
std::uint8_t PieceAndColorCompactType
Compact type for PieceAndColor. The compact type can store all legal enumeration values.
Definition chessboard-types.h:69
constexpr Square getSquareForIndex(std::size_t index) noexcept
Returns a square for an index. In essence, this is the ordinal of the square.
Definition chessboard-types.h:358
@ BLACK_NONE
Special value to make makePieceAndColor(Piece::NONE, Color::BLACK) well-defined.
@ WHITE_KNIGHT
White knight.
@ BLACK_BISHOP
Black bishop.
@ WHITE_BISHOP
White bishop.
@ BLACK_KNIGHT
Black knight.
@ BLACK_QUEEN
Black queen.
@ WHITE_NONE
Special value to make makePieceAndColor(Piece::NONE, Color::WHITE) well-defined.
@ WHITE_QUEEN
White queen.
@ 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)
@ NONE
Null token (placeholder only)
Definition pgnscannertokens.h:39
Definition chessboard-types-squareset.h:30