generate Direction Consts
This commit is contained in:
37
include/chess/types.h
Normal file
37
include/chess/types.h
Normal file
@ -0,0 +1,37 @@
|
||||
#ifndef CHESS_TYPES_H
|
||||
#define CHESS_TYPES_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define BOARD_SIZE 8
|
||||
#define TOTAL_BOARD_SIZE BOARD_SIZE * BOARD_SIZE
|
||||
#define LENGTH(array) (sizeof array / sizeof *array)
|
||||
#define NOT_SELECTED UINT_LEAST8_MAX
|
||||
|
||||
enum pieces {
|
||||
ALL_PIECES,
|
||||
KING,
|
||||
QUEEN,
|
||||
ROOK,
|
||||
BISHOP,
|
||||
KNIGHT,
|
||||
PAWN,
|
||||
PIECES_LENGTH
|
||||
};
|
||||
|
||||
enum color {
|
||||
BLACK,
|
||||
WHITE
|
||||
};
|
||||
|
||||
struct piece_t {
|
||||
uint_least8_t type;
|
||||
bool color;
|
||||
};
|
||||
|
||||
enum directions {
|
||||
NORTH, NORTHWEST, WEST, SOUTHWEST, SOUTH, SOUTHEAST, EAST, NORTHEAST, DIRECTION_LENGTH
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user