diff -r daaf6e5b3501 -r 41468077b5bb src/game.h --- a/src/game.h Wed Mar 19 10:08:25 2014 +0100 +++ b/src/game.h Wed Mar 19 15:36:54 2014 +0100 @@ -31,11 +31,40 @@ #define GAME_H #include "terminal-chess.h" +#include #ifdef __cplusplus extern "C" { #endif +#define PIECE_MASK 0x0F +#define COLOR_MASK 0xF0 + +#define WHITE 0x10 +#define BLACK 0x20 + +#define PAWN 0x01 +#define ROOK 0x02 +#define KNIGHT 0x03 +#define BISHOP 0x04 +#define QUEEN 0x05 +#define KING 0x06 + +#define WPAWN (WHITE|PAWN) +#define WROOK (WHITE|ROOK) +#define WKNIGHT (WHITE|KNIGHT) +#define WBISHOP (WHITE|BISHOP) +#define WQUEEN (WHITE|QUEEN) +#define WKING (WHITE|KING) +#define BPAWN (BLACK|PAWN) +#define BROOK (BLACK|ROOK) +#define BKNIGHT (BLACK|KNIGHT) +#define BBISHOP (BLACK|BISHOP) +#define BQUEEN (BLACK|QUEEN) +#define BKING (BLACK|KING) + +typedef uint8_t Board[8][8]; + void game_start(Settings *settings, int opponent); #ifdef __cplusplus