mbrown1413 / Mechanical-Puzzle-Studio

The Swiss Army knife of mechanical puzzle design.
https://puzzlestudio.io/
Mozilla Public License 2.0
1 stars 0 forks source link

[Grid] Clear solutions when grid changes #90

Closed mbrown1413 closed 2 months ago

mbrown1413 commented 3 months ago

When grids change, we clear invalid voxels from pieces but we don't do this for solutions. This could cause old voxels to be placed on the new grid, which could throw an error.

The most general way to resolve this would be to delete all solutions when the grid changes. We could possibly enumerate all voxels in solutions and delete the solution if it contains invalid voxels, but we can't do this in general since we could have completely different problem/solution classes (well, I guess we could add to the solution API to "validate" it against the new grid).

Of course, no matter what we do, we'll have to explain it to the user in the grid edit modal.