RestoreRaw.encode: def of bendvy-ecs-core@0.1.0.4 Import: import bendvy-ecs-core@0.1.0.4/restore_raw.bend as RestoreRaw Lines 112-117 of bendvy-ecs-core@0.1.0.4/restore_raw.bend: https://jend.leeeet.dev/read.txt?path=bendvy-ecs-core@0.1.0.4/restore_raw.bend&start_line=112&end_line=117 import Base import bendvy-ecs-core@0.1.0.4/decode_data.bend as D import bendvy-ecs-core@0.1.0.4/snapshot_data.bend as Snapshot # Encode typed Snapshot to the four-field Raw representation preserving entity and # field order. This is not schema validation, JSON serialization or a Runtime # checkpoint; an arbitrary typed Snapshot may still be refused by restore. def encode(value:Snapshot.Snapshot) -> D.Raw: match value: case Snapshot.Snapshot{version,next,entities,resources}:D.Object{[D.Field{"version",D.Number{version}},D.Field{"nextEntity",D.Number{next}},D.Field{"entities",D.Array{saved_entities(entities)}},D.Field{"resources",D.Object{resources}}]} Uses (5): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/decode_data.bend&name=Field https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/decode_data.bend&name=Raw https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/restore_raw.bend&name=saved_entities https://jend.leeeet.dev/definition.txt?path=bendvy-ecs-core@0.1.0.4/snapshot_data.bend&name=Snapshot