Chess 0.0.1
A library written in c
|
Defines the chess piece type type and related utility functions for representing and manipulating chess piece types. More...
Go to the source code of this file.
Enumerations | |
enum | ChessPieceType : uint8_t { CHESS_PIECE_TYPE_PAWN = 0 , CHESS_PIECE_TYPE_KNIGHT = 1 , CHESS_PIECE_TYPE_BISHOP = 2 , CHESS_PIECE_TYPE_ROOK = 3 , CHESS_PIECE_TYPE_QUEEN = 4 , CHESS_PIECE_TYPE_KING = 5 , CHESS_PIECE_TYPE_NONE = 6 } |
Represents the types of chess pieces. More... | |
Functions | |
void | chess_piece_type_debug (ChessPieceType type) |
Prints a debug representation of the given piece type. | |
bool | chess_piece_type_is_valid (ChessPieceType type) |
Checks if the given piece type is valid. | |
size_t | chess_piece_type_from_algebraic (ChessPieceType *type, const char *string) |
Parses a piece type from algebraic notation (e.g., "P", "N", ..., "K"). | |
size_t | chess_piece_type_to_algebraic (ChessPieceType type, char *string, size_t string_size) |
Converts a piece type to algebraic notation (e.g., "P", "N", ..., "K"). | |
Defines the chess piece type type and related utility functions for representing and manipulating chess piece types.
enum ChessPieceType : uint8_t |
Represents the types of chess pieces.
void chess_piece_type_debug | ( | ChessPieceType | type | ) |
Prints a debug representation of the given piece type.
[in] | type | The piece type to print. |
size_t chess_piece_type_from_algebraic | ( | ChessPieceType * | type, |
const char * | string | ||
) |
Parses a piece type from algebraic notation (e.g., "P", "N", ..., "K").
[out] | type | Pointer to store the parsed piece type. |
[in] | string | The string containing the algebraic notation. |
bool chess_piece_type_is_valid | ( | ChessPieceType | type | ) |
Checks if the given piece type is valid.
[in] | type | The piece type to check. |
size_t chess_piece_type_to_algebraic | ( | ChessPieceType | type, |
char * | string, | ||
size_t | string_size | ||
) |
Converts a piece type to algebraic notation (e.g., "P", "N", ..., "K").
[in] | type | The piece type to convert. |
[out] | string | The buffer to store the algebraic notation. |
[in] | string_size | The size of the output buffer. |