Lost Lily/Grid ToolkitDocs 1.0
Table of Contents

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.

Complete Save and Restore example in Play Mode showing the board, mutation controls, saved state comparison, and restoration status.
The complete example compares structures, conditions, metadata, and extension-backed values before and after atomic restoration.

Try it

  1. Edit a structure by moving or rotating it.
  2. Change a condition or metadata value with the provided controls.
  3. Press Save and note the snapshot summary.
  4. Mutate several different values, including a structure placement.
  5. 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.

Next sample

Continue with Build on a 1,000-cell board.