A save is a copy of the run: Capture stores Zone.Snapshot(), a MessagePack round trip, never the live stack and run objects

Closes follow-up save-shares-live-objects. EntitySerializer.Copy is the one copy; every zone of a run is live, so Capture requires Contents and the PackedContents fallback is gone.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
soul 2026-11-28 20:20:25 +01:00
commit 3e9a862a7a
11 changed files with 85 additions and 3 deletions

View file

@ -742,9 +742,12 @@ public sealed partial class RunStartTests
public void InfluenceScaleRoundTripsAndOldSavesAreRefused()
{
var arena = Arena(true);
LiveRegion.Fill(_items, _galaxy);
var (demo, _) = RunSave.Capture(_cache, _galaxy, arena, null, new SavedActionBarBinding[0], 0);
Assert.Equal(.5f, demo.InfluenceScale);
var (main, _) = RunSave.Capture(_cache, MainSectorGalaxy(), arena, null, new SavedActionBarBinding[0], 0);
var mainGalaxy = MainSectorGalaxy();
LiveRegion.Fill(_items, mainGalaxy);
var (main, _) = RunSave.Capture(_cache, mainGalaxy, arena, null, new SavedActionBarBinding[0], 0);
Assert.Equal(1f, main.InfluenceScale);
var old = Assert.Throws<InvalidOperationException>(() => new Galaxy(_cache, new SavedGame