From 89fdc09c29f1219a7660ad6d1839cc914a009c02 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 28 Jun 2005 11:14:09 +0000 Subject: More serialisation changes: the game_aux_info structure has now been retired, and replaced with a simple string. Most of the games which use it simply encode the string in the same way that the Solve move will also be encoded, i.e. solve_game() simply returns dupstr(aux_info). Again, this is a better approach than writing separate game_aux_info serialise/deserialise functions because doing it this way is self-testing (the strings are created and parsed during the course of any Solve operation at all). [originally from svn r6029] --- twiddle.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'twiddle.c') diff --git a/twiddle.c b/twiddle.c index 02b1d79..06dbaed 100644 --- a/twiddle.c +++ b/twiddle.c @@ -307,7 +307,7 @@ static int grid_complete(int *grid, int wh, int orientable) } static char *new_game_desc(game_params *params, random_state *rs, - game_aux_info **aux, int interactive) + char **aux, int interactive) { int *grid; int w = params->w, h = params->h, n = params->n, wh = w*h; @@ -430,11 +430,6 @@ static char *new_game_desc(game_params *params, random_state *rs, return ret; } -static void game_free_aux_info(game_aux_info *aux) -{ - assert(!"Shouldn't happen"); -} - static char *validate_desc(game_params *params, char *desc) { char *p, *err; @@ -547,7 +542,7 @@ static int compare_int(const void *av, const void *bv) } static char *solve_game(game_state *state, game_state *currstate, - game_aux_info *aux, char **error) + char *aux, char **error) { return dupstr("S"); } @@ -1224,7 +1219,6 @@ const struct game thegame = { TRUE, game_configure, custom_params, validate_params, new_game_desc, - game_free_aux_info, validate_desc, new_game, dup_game, -- cgit v1.1