diff options
| author | Simon Tatham <anakin@pobox.com> | 2023-04-20 17:27:21 +0100 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2023-04-20 18:39:41 +0100 |
| commit | c5e253a9f9d3d651227ccad56e2c7526ee1f3eba (patch) | |
| tree | d5054843aa49a7ae0d793b6d26f162aead5bbdfd /tracks.c | |
| parent | 14e1e05510ac02a5502823bafe46d98c6fab3e5c (diff) | |
| download | puzzles-c5e253a9f9d3d651227ccad56e2c7526ee1f3eba.zip puzzles-c5e253a9f9d3d651227ccad56e2c7526ee1f3eba.tar.gz puzzles-c5e253a9f9d3d651227ccad56e2c7526ee1f3eba.tar.bz2 puzzles-c5e253a9f9d3d651227ccad56e2c7526ee1f3eba.tar.xz | |
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.
Diffstat (limited to 'tracks.c')
| -rw-r--r-- | tracks.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1374,7 +1374,7 @@ static int solve_check_loop(game_state *state) /* TODO eventually we should pull this out into a solver struct and keep it updated as we connect squares. For now we recreate it every time we try this particular solver step. */ - dsf = snew_dsf(w*h); + dsf = dsf_new(w*h); /* Work out the connectedness of the current loop set. */ for (x = 0; x < w; x++) { @@ -1465,7 +1465,7 @@ static int solve_bridge_sub(game_state *state, int x, int y, int d, assert(d == D || d == R); if (!sc->dsf) - sc->dsf = snew_dsf(wh); + sc->dsf = dsf_new(wh); dsf_reinit(sc->dsf); for (xi = 0; xi < w; xi++) { @@ -1879,7 +1879,7 @@ static bool check_completion(game_state *state, bool mark) } } - dsf = snew_dsf(w*h); + dsf = dsf_new(w*h); for (x = 0; x < w; x++) { for (y = 0; y < h; y++) { |