X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=dvonn-board.h;h=a150b2541f7fdc5fe9566fded72662d6bec196d0;hb=dd85972d53ba5f88eb9b4eb3cb229e1d0e8b8f1a;hp=66464d8dee95d9fbd421dfc466cb70e6b3dfada9;hpb=74df2492e8c32df37d886dec4baf9344dc6b8cff;p=dvonn diff --git a/dvonn-board.h b/dvonn-board.h index 66464d8..a150b25 100644 --- a/dvonn-board.h +++ b/dvonn-board.h @@ -53,7 +53,8 @@ typedef struct { typedef enum { DVONN_PHASE_PLACEMENT, - DVONN_PHASE_MOVEMENT + DVONN_PHASE_MOVEMENT, + DVONN_PHASE_GAME_OVER } dvonn_phase_t; typedef struct { @@ -61,6 +62,7 @@ typedef struct { dvonn_phase_t phase; dvonn_player_t player; int moves; + int score[2]; /* index by dvonn_player_t */ } dvonn_board_t; /* Initialize a board for a new game of DVONN. */ @@ -94,6 +96,13 @@ dvonn_bool_t dvonn_board_cell_occupied (dvonn_board_t *board, int x, int y); +/* Is the cell at (x,y) occupied by a piece (or stack) with the given + * player's piece at the top. Returns FALSE for all out-of-bounds + * coordinates. */ +dvonn_bool_t +dvonn_board_cell_owned_by (dvonn_board_t *board, + int x, int y, dvonn_player_t player); + /* 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