EntitySerializer.RestoreWorldFromSnapshot(IEntityWorld, WorldSnapshot) Method
Definition
Namespace: Brine2D.ECS.Serialization
Restores entities from a snapshot into the world, preserving the parent–child hierarchy. CLEARS the existing world's entities first, but leaves registered systems intact.
C#
public void RestoreWorldFromSnapshot(Brine2D.ECS.IEntityWorld world, Brine2D.ECS.Serialization.WorldSnapshot snapshot);
Parameters
world IEntityWorld
snapshot WorldSnapshot
Remarks
Uses a two-pass strategy: all entities are created in the first pass, then parent–child relationships are re-established in the second pass using the snapshot IDs recorded by CreateSnapshot\(Entity\). This means Id values are used as keys during restore but are not injected back into the restored entities' runtime IDs.