mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
Reorganise the dsf API into three kinds of dsf.
This is preparing to separate out the auxiliary functionality, and perhaps leave space for making more of it in future. The previous name 'edsf' was too vague: the 'e' stood for 'extended', and didn't say anything about _how_ it was extended. It's now called a 'flip dsf', since it tracks whether elements in the same class are flipped relative to each other. More importantly, clients that are going to use the flip tracking must say so when they allocate the dsf. And Keen's need to track the minimal element of an equivalence class is going to become a non-default feature, so there needs to be a new kind of dsf that specially tracks those, and Keen will have to call it. While I'm here, I've renamed the three dsf creation functions so that they start with 'dsf_' like all the rest of the dsf API.
This commit is contained in:
4
pearl.c
4
pearl.c
@ -350,7 +350,7 @@ static int pearl_solve(int w, int h, char *clues, char *result,
|
||||
* We maintain a dsf of connected squares, together with a
|
||||
* count of the size of each equivalence class.
|
||||
*/
|
||||
dsf = snew_dsf(w*h);
|
||||
dsf = dsf_new(w*h);
|
||||
dsfsize = snewn(w*h, int);
|
||||
|
||||
/*
|
||||
@ -1577,7 +1577,7 @@ static bool check_completion(game_state *state, bool mark)
|
||||
* same reasons, since Loopy and Pearl have basically the same
|
||||
* form of expected solution.
|
||||
*/
|
||||
dsf = snew_dsf(w*h);
|
||||
dsf = dsf_new(w*h);
|
||||
|
||||
/* Build the dsf. */
|
||||
for (x = 0; x < w; x++) {
|
||||
|
Reference in New Issue
Block a user