8#ifndef CHESS_PIECE_TYPE_H_INCLUDED
9#define CHESS_PIECE_TYPE_H_INCLUDED
17#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L
Defines macros and constants for the library.
#define CHESS_ENUM(type, name)
Defines a typed enum or a typedef enum based on the availability of typed enums in the compiler.
Definition macros.h:84
void chess_piece_type_debug(ChessPieceType type)
Prints a debug representation of the given piece type.
ChessPieceType
Represents the types of chess pieces.
Definition piece_type.h:27
@ CHESS_PIECE_TYPE_PAWN
Definition piece_type.h:28
@ CHESS_PIECE_TYPE_ROOK
Definition piece_type.h:31
@ CHESS_PIECE_TYPE_BISHOP
Definition piece_type.h:30
@ CHESS_PIECE_TYPE_KNIGHT
Definition piece_type.h:29
@ CHESS_PIECE_TYPE_QUEEN
Definition piece_type.h:32
@ CHESS_PIECE_TYPE_NONE
Definition piece_type.h:35
@ CHESS_PIECE_TYPE_KING
Definition piece_type.h:33
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").
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").