]> git.cworth.org Git - loudgame/blobdiff - loa-board.h
Export and document loa_board_move_is_legal
[loudgame] / loa-board.h
index da48c7238e72cbf90ed1cfb7617ceeeaa35bd362..9c3c466a0ef321685eaf470f7c4d8ae21ea0e592 100644 (file)
@@ -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