diff options
| author | Simon Tatham <anakin@pobox.com> | 2011-06-19 13:43:35 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2011-06-19 13:43:35 +0000 |
| commit | 73daff393722196bf48244ca95dd4f64a351a473 (patch) | |
| tree | 7ec80b64bd497a886d3e33bdd4d666e87937e042 /puzzles.h | |
| parent | 8dcdb33b77ebbe56d0ad385285d21344df5ac5f9 (diff) | |
| download | puzzles-73daff393722196bf48244ca95dd4f64a351a473.zip puzzles-73daff393722196bf48244ca95dd4f64a351a473.tar.gz puzzles-73daff393722196bf48244ca95dd4f64a351a473.tar.bz2 puzzles-73daff393722196bf48244ca95dd4f64a351a473.tar.xz | |
Changed my mind about midend_is_solved: I've now reprototyped it as
midend_status(), and given it three return codes for win, (permanent)
loss and game-still-in-play. Depending on what the front end wants to
use it for, it may find any or all of these three states worth
distinguishing from each other.
(I suppose a further enhancement might be to add _non_-permanent loss
as a fourth distinct status, to describe situations in which you can't
play further without pressing Undo but doing so is not completely
pointless. That might reasonably include dead-end situations in Same
Game and Pegs, and blown-self-up situations in Mines and Inertia.
However, I haven't done this at present.)
[originally from svn r9179]
Diffstat (limited to 'puzzles.h')
| -rw-r--r-- | puzzles.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -253,7 +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_status(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); @@ -479,7 +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 (*status)(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); |