X-Git-Url: https://git.cworth.org/git?p=loudgame;a=blobdiff_plain;f=loa-board.h;fp=loa-board.h;h=9c3c466a0ef321685eaf470f7c4d8ae21ea0e592;hp=da48c7238e72cbf90ed1cfb7617ceeeaa35bd362;hb=e8c3a13a4e33e77a6fea0be26a4b15fea7afb257;hpb=f37ff234d97a4fb8532f8c9387fb7fff5780afaf diff --git a/loa-board.h b/loa-board.h index da48c72..9c3c466 100644 --- a/loa-board.h +++ b/loa-board.h @@ -107,16 +107,31 @@ loa_board_reset (loa_board_t *board); int loa_board_is_won (loa_board_t *board, int x, int y); -/* Move a piece from (x1,y1) to (x2,y2) where (0,0) is at the - * upper-left corner of the board. Returns TRUE if the move is legal - * and is performed. If the move is not legal this function returns - * FALSE, no change will be performed on the board, and *error will be - * set to a string describing why the move is illegal.*/ -int +/* Move a piece from (move->x1,move->y1) to (move->x2,move->y2) where + * (0,0) is at the upper-left corner of the board. Returns TRUE if the + * move is legal and is performed. If the move is not legal this + * function returns FALSE, no change will be performed on the board, + * and *error will be set to a string describing why the move is + * illegal. + * + * After this function returns, the move->is_capture field will be set + * as appropriate whether the move is a capture or not. + */ +loa_bool_t loa_board_move (loa_board_t *board, loa_move_t *move, char **error); +/* Check whether a move is legal, but without performing the move. + * + * After this function returns, the move->is_capture field will be set + * as appropriate whether the move is a capture or not. + */ +loa_bool_t +loa_board_move_is_legal (loa_board_t *board, + loa_move_t *move, + char **error); + /* Execute a 'pass'---changing the player-to-move from the current * player to the opponent. Returns TRUE if the pass is executed. Will * eventually return FALSE if the current player has a legal move that