X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=dvonn-board.h;h=7a361c3e6e3f3ebc2bdb415f9bae69352b096414;hb=ad4d9127c5dd419f84da2329c60b3f785c068e66;hp=b0ee8cc46a449dfd5d7d4f4201b68140520567fe;hpb=0eff3c58b93ea73e7f1aa866f6e317714479dd6e;p=dvonn diff --git a/dvonn-board.h b/dvonn-board.h index b0ee8cc..7a361c3 100644 --- a/dvonn-board.h +++ b/dvonn-board.h @@ -45,6 +45,7 @@ typedef enum { typedef struct { dvonn_cell_type_t type; int height; + dvonn_bool_t contains_red; } dvonn_cell_t; #define DVONN_BOARD_X_SIZE 11 @@ -87,4 +88,23 @@ dvonn_board_move (dvonn_board_t *board, int x2, int y2, char **error); +/* Pass rather than moving, allowing the turn to pass to the + * opponent. This should only be allowed if there are no legal moves, + * but that is not yet enforced. Returns TRUE if the pass succeeds. */ +int +dvonn_board_pass (dvonn_board_t *board); + +/* Is the cell at (x,y) occupied by a piece. Returns FALSE for all + * out-of-bounds coordinates. */ +dvonn_bool_t +dvonn_board_cell_occupied (dvonn_board_t *board, + int x, int y); + +/* Is the cell at (x,y) surrounded by other pieces, (such that it is + * not legal for a piece at (x,y) to move. */ +dvonn_bool_t +dvonn_board_cell_surrounded (dvonn_board_t *board, + int x, int y); + + #endif