src/chess/rules.h

changeset 122
e65d9b5e9324
parent 115
206201d544be
--- a/src/chess/rules.h	Tue May 19 17:59:24 2026 +0200
+++ b/src/chess/rules.h	Tue May 19 18:03:06 2026 +0200
@@ -249,6 +249,18 @@
 void apply_move(GameState *gamestate, Move *move);
 
 /**
+ * Copies the state of the game at the specified move number.
+ *
+ * This function is helpful to generate a game state for reviewing past moves.
+ *
+ * @param gamestate the current game state
+ * @param move_number the half-move that would now be played
+ * @param replay the struct to populate with the state at the specified move
+ */
+void gamestate_at_move(GameState *gamestate,
+        unsigned move_number, GameState *replay);
+
+/**
  * Returns the remaining time on the clock for the specified
  * half-move number.
  *

mercurial