mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
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]
This commit is contained in:
10
mines.c
10
mines.c
@ -1946,7 +1946,7 @@ static char *new_mine_layout(int w, int h, int n, int x, int y, int unique,
|
||||
}
|
||||
|
||||
static char *new_game_desc(game_params *params, random_state *rs,
|
||||
game_aux_info **aux, int interactive)
|
||||
char **aux, int interactive)
|
||||
{
|
||||
/*
|
||||
* We generate the coordinates of an initial click even if they
|
||||
@ -1984,11 +1984,6 @@ static char *new_game_desc(game_params *params, random_state *rs,
|
||||
}
|
||||
}
|
||||
|
||||
static void game_free_aux_info(game_aux_info *aux)
|
||||
{
|
||||
assert(!"Shouldn't happen");
|
||||
}
|
||||
|
||||
static char *validate_desc(game_params *params, char *desc)
|
||||
{
|
||||
int wh = params->w * params->h;
|
||||
@ -2298,7 +2293,7 @@ static void free_game(game_state *state)
|
||||
}
|
||||
|
||||
static char *solve_game(game_state *state, game_state *currstate,
|
||||
game_aux_info *aux, char **error)
|
||||
char *aux, char **error)
|
||||
{
|
||||
if (!state->layout->mines) {
|
||||
*error = "Game has not been started yet";
|
||||
@ -3045,7 +3040,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,
|
||||
|
Reference in New Issue
Block a user