97 typedef struct { |
98 typedef struct { |
98 Board board; |
99 Board board; |
99 MoveList* movelist; |
100 MoveList* movelist; |
100 MoveList* lastmove; |
101 MoveList* lastmove; |
101 unsigned int movecount; /* number of (half-)moves (counting BOTH colors) */ |
102 unsigned int movecount; /* number of (half-)moves (counting BOTH colors) */ |
102 _Bool checkmate; |
103 bool checkmate; |
103 _Bool stalemate; |
104 bool stalemate; |
104 _Bool remis; |
105 bool remis; |
105 _Bool resign; |
106 bool resign; |
106 } GameState; |
107 } GameState; |
107 |
108 |
108 |
109 |
109 #define is_game_running(gamestate) !((gamestate)->checkmate || \ |
110 #define is_game_running(gamestate) !((gamestate)->checkmate || \ |
110 (gamestate)->resign || (gamestate)->stalemate || (gamestate)->remis) |
111 (gamestate)->resign || (gamestate)->stalemate || (gamestate)->remis) |