Inspect complete snapshot restoration
What this teaches
This example goes beyond the basic token tutorial. It captures every mutable value represented by a GridBoardStateSnapshot, including structures, conditions, Cell Metadata, and registered extension payloads, then restores them as one validated commit.
Open and run
Menu path: Tools > Lost Lily > Grid Toolkit > Samples > Open > Save and Restore.
Enter Play Mode. Use the mouse to select, drag, and place; press R to rotate, Delete to remove, and Escape to cancel. Use the on-screen Save, mutation, and Restore controls.
Try it
- Edit a structure by moving or rotating it.
- Change a condition or metadata value with the provided controls.
- Press Save and note the snapshot summary.
- Mutate several different values, including a structure placement.
- Press Restore and compare every displayed value to the saved summary.
Checkpoint
All supported values return to the saved state together, and the HUD reports successful atomic restoration. The current revision advances for the restore commit; it does not rewind to the snapshot's source revision. Reset rebuilds the example's authored baseline.
How it works
| Scene part | Public system | Responsibility |
|---|---|---|
| Snapshot capture | GridBoardStateSnapshot |
Holds independent board and extension data. |
| Resolver set | GridExtensionSnapshotResolverSet | Converts supported extension ownership to and from payloads. |
| Restore | GridActionRunner | Validates and applies the complete difference atomically. |
| View | GridBoardView | Reconciles the committed restored state. |
Try another variation
In a duplicated scene, save, mutate one category at a time, and verify each category returns.
Troubleshooting
| Symptom | Fix |
|---|---|
| An extension value does not restore. | Register its snapshot resolver before capture and restore. |
| Restore is rejected. | Read the first diagnostic; no partial state is committed. |
Related
- Snapshots and restoration
- Snapshot resolvers
- GridBoardStateSnapshot
- GridExtensionSnapshotResolverSet
- GridActionRunner
Next sample
Continue with Build on a 1,000-cell board.