diff -r 2aed5418e142 -r 6008840b859e src/game.h --- a/src/game.h Sat Mar 29 14:46:33 2014 +0100 +++ b/src/game.h Sat Mar 29 16:53:58 2014 +0100 @@ -72,11 +72,25 @@ uint8_t fromrow; uint8_t tofile; uint8_t torow; + uint8_t promotion; _Bool check; _Bool checkmate; _Bool capture; } Move; +typedef struct MoveList MoveList; +typedef struct MoveListRoot MoveListRoot; + +struct MoveListRoot { + MoveList* first; + MoveList* last; +}; + +struct MoveList { + Move move; + MoveList* next; +}; + #define POS_UNSPECIFIED UINT8_MAX #define mdst(b,m) b[(m)->torow][(m)->tofile] #define msrc(b,m) b[(m)->fromrow][(m)->fromfile] @@ -89,6 +103,9 @@ #define rowidx(row) (row-'1') #define fileidx(file) (file-'a') +#define rowchr(row) (row+'1') +#define filechr(file) (file+'a') + #define chkidx(move) (isidx((move)->fromfile) && isidx((move)->fromrow) && \ isidx((move)->tofile) && isidx((move)->torow)) @@ -98,6 +115,9 @@ void game_start(Settings *settings, int opponent); +void freemovelist(MoveListRoot* list); +void addmove(MoveListRoot *movelist, Move *move); + #ifdef __cplusplus } #endif