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]
This commit is contained in:
Simon Tatham
2011-06-19 13:43:35 +00:00
parent 8dcdb33b77
commit 73daff3937
42 changed files with 188 additions and 164 deletions

View File

@ -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);