]> git.cworth.org Git - loudgame/blobdiff - loa-board.h
Update documentation of move command for new syntax
[loudgame] / loa-board.h
index 4a4f690855fdd1541d365c29af262e6b5c0acfab..9c3c466a0ef321685eaf470f7c4d8ae21ea0e592 100644 (file)
@@ -107,17 +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,
-               int x1, int y1,
-               int x2, int y2,
+               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