aboutsummaryrefslogtreecommitdiff
path: root/puzzles.h
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2011-04-02 16:19:12 +0000
committerSimon Tatham <anakin@pobox.com>2011-04-02 16:19:12 +0000
commit980880be1f2801b2a69fcc67abc0f5827fd106f2 (patch)
treea500e629474755854d638bb21bcac4c3428f0707 /puzzles.h
parent8c6c8df8f4bd07602931485956fce524925dc2bb (diff)
downloadpuzzles-980880be1f2801b2a69fcc67abc0f5827fd106f2.zip
puzzles-980880be1f2801b2a69fcc67abc0f5827fd106f2.tar.gz
puzzles-980880be1f2801b2a69fcc67abc0f5827fd106f2.tar.bz2
puzzles-980880be1f2801b2a69fcc67abc0f5827fd106f2.tar.xz
Add a function to every game backend which indicates whether a game
state is in a solved position, and a midend function wrapping it. (Or, at least, a situation in which further play is pointless. The point is, given that game state, would it be a good idea for a front end that does that sort of thing to proactively provide the option to start a fresh game?) [originally from svn r9140]
Diffstat (limited to 'puzzles.h')
-rw-r--r--puzzles.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/puzzles.h b/puzzles.h
index 6933e70..1561f4a 100644
--- a/puzzles.h
+++ b/puzzles.h
@@ -253,6 +253,7 @@ char *midend_get_game_id(midend *me);
int midend_can_format_as_text_now(midend *me);
char *midend_text_format(midend *me);
char *midend_solve(midend *me);
+int midend_is_solved(midend *me);
int midend_can_undo(midend *me);
int midend_can_redo(midend *me);
void midend_supersede_game_desc(midend *me, char *desc, char *privdesc);
@@ -478,6 +479,7 @@ struct game {
game_ui *ui);
float (*flash_length)(game_state *oldstate, game_state *newstate, int dir,
game_ui *ui);
+ int (*is_solved)(game_state *state);
int can_print, can_print_in_colour;
void (*print_size)(game_params *params, float *x, float *y);
void (*print)(drawing *dr, game_state *state, int tilesize);