GameSim snapshots the state before each undoable command (PlacePiece / RemovePiece / MovePiece) into a bounded LinkedList stack (max 32). Undo() pops the last checkpoint and emits StateRestoredEvent, reusing the presentation rebuild path already wired for QuickLoad. Ctrl+Z in Main triggers the engine method; the harness exposes undo() for tests. QuickLoad clears the stack (fresh timeline). Seven unit tests cover empty stack, place/remove/move undo, reverse-order multiple undos, rejected commands not checkpointing, and post-simulation rewind. |
||
|---|---|---|
| .. | ||
| CampaignTests.cs | ||
| CampaignTests.cs.uid | ||
| FullLevelTests.cs | ||
| FullLevelTests.cs.uid | ||
| GameSimTests.cs | ||
| GameSimTests.cs.uid | ||
| PhaseTests.cs | ||
| PhaseTests.cs.uid | ||
| QuickSaveTests.cs | ||
| SolvabilityTests.cs | ||
| SolvabilityTests.cs.uid | ||
| TransformerTests.cs | ||
| TransformerTests.cs.uid | ||
| UndoTests.cs | ||