@oasys/oecs 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +553 -0
- package/README.md +207 -267
- package/dist/core/ecs/access_check.d.cts +77 -0
- package/dist/core/ecs/access_check.d.ts +77 -0
- package/dist/core/ecs/access_check.d.ts.map +1 -0
- package/dist/core/ecs/archetype.d.cts +486 -0
- package/dist/core/ecs/archetype.d.ts +486 -0
- package/dist/core/ecs/archetype.d.ts.map +1 -0
- package/dist/core/ecs/archetype_graph.d.cts +96 -0
- package/dist/core/ecs/archetype_graph.d.ts +96 -0
- package/dist/core/ecs/archetype_graph.d.ts.map +1 -0
- package/dist/core/ecs/builtin_relations.d.cts +43 -0
- package/dist/core/ecs/builtin_relations.d.ts +43 -0
- package/dist/core/ecs/builtin_relations.d.ts.map +1 -0
- package/dist/core/ecs/command_log.d.cts +116 -0
- package/dist/core/ecs/command_log.d.ts +116 -0
- package/dist/core/ecs/command_log.d.ts.map +1 -0
- package/dist/core/ecs/component.d.cts +176 -0
- package/dist/core/ecs/component.d.ts +176 -0
- package/dist/core/ecs/component.d.ts.map +1 -0
- package/dist/core/ecs/compute_backend.d.cts +37 -0
- package/dist/core/ecs/compute_backend.d.ts +37 -0
- package/dist/core/ecs/compute_backend.d.ts.map +1 -0
- package/dist/core/ecs/debug_names.d.cts +7 -0
- package/dist/core/ecs/debug_names.d.ts +7 -0
- package/dist/core/ecs/debug_names.d.ts.map +1 -0
- package/dist/core/ecs/deferred_commands.d.cts +55 -0
- package/dist/core/ecs/deferred_commands.d.ts +55 -0
- package/dist/core/ecs/deferred_commands.d.ts.map +1 -0
- package/dist/core/ecs/dispatch_trace.d.cts +93 -0
- package/dist/core/ecs/dispatch_trace.d.ts +93 -0
- package/dist/core/ecs/dispatch_trace.d.ts.map +1 -0
- package/dist/core/ecs/ecs.d.cts +562 -0
- package/dist/core/ecs/ecs.d.ts +562 -0
- package/dist/core/ecs/ecs.d.ts.map +1 -0
- package/dist/core/ecs/ecs_memory.d.cts +179 -0
- package/dist/core/ecs/ecs_memory.d.ts +179 -0
- package/dist/core/ecs/ecs_memory.d.ts.map +1 -0
- package/dist/core/ecs/entity.d.cts +34 -0
- package/dist/core/ecs/entity.d.ts +34 -0
- package/dist/core/ecs/entity.d.ts.map +1 -0
- package/dist/core/ecs/entity_allocator.d.cts +59 -0
- package/dist/core/ecs/entity_allocator.d.ts +59 -0
- package/dist/core/ecs/entity_allocator.d.ts.map +1 -0
- package/dist/core/ecs/event.d.cts +79 -0
- package/dist/core/ecs/event.d.ts +79 -0
- package/dist/core/ecs/event.d.ts.map +1 -0
- package/dist/core/ecs/event_registry.d.cts +22 -0
- package/dist/core/ecs/event_registry.d.ts +22 -0
- package/dist/core/ecs/event_registry.d.ts.map +1 -0
- package/dist/core/ecs/facades.d.cts +158 -0
- package/dist/core/ecs/facades.d.ts +158 -0
- package/dist/core/ecs/facades.d.ts.map +1 -0
- package/dist/core/ecs/frame_stepper.d.cts +58 -0
- package/dist/core/ecs/frame_stepper.d.ts +58 -0
- package/dist/core/ecs/frame_stepper.d.ts.map +1 -0
- package/dist/core/ecs/frame_trace.d.cts +133 -0
- package/dist/core/ecs/frame_trace.d.ts +133 -0
- package/dist/core/ecs/frame_trace.d.ts.map +1 -0
- package/dist/core/ecs/host_commands.d.cts +274 -0
- package/dist/core/ecs/host_commands.d.ts +274 -0
- package/dist/core/ecs/host_commands.d.ts.map +1 -0
- package/dist/core/ecs/index.d.cts +46 -0
- package/dist/core/ecs/index.d.ts +46 -0
- package/dist/core/ecs/index.d.ts.map +1 -0
- package/dist/core/ecs/observer.d.cts +173 -0
- package/dist/core/ecs/observer.d.ts +173 -0
- package/dist/core/ecs/observer.d.ts.map +1 -0
- package/dist/core/ecs/query.d.cts +718 -0
- package/dist/core/ecs/query.d.ts +718 -0
- package/dist/core/ecs/query.d.ts.map +1 -0
- package/dist/core/ecs/ref.d.cts +31 -0
- package/dist/core/ecs/ref.d.ts +31 -0
- package/dist/core/ecs/ref.d.ts.map +1 -0
- package/dist/core/ecs/relation.d.cts +243 -0
- package/dist/core/ecs/relation.d.ts +243 -0
- package/dist/core/ecs/relation.d.ts.map +1 -0
- package/dist/core/ecs/relation_service.d.cts +235 -0
- package/dist/core/ecs/relation_service.d.ts +235 -0
- package/dist/core/ecs/relation_service.d.ts.map +1 -0
- package/dist/core/ecs/resource.d.cts +53 -0
- package/dist/core/ecs/resource.d.ts +53 -0
- package/dist/core/ecs/resource.d.ts.map +1 -0
- package/dist/core/ecs/resource_registry.d.cts +20 -0
- package/dist/core/ecs/resource_registry.d.ts +20 -0
- package/dist/core/ecs/resource_registry.d.ts.map +1 -0
- package/dist/core/ecs/resume.d.cts +85 -0
- package/dist/core/ecs/resume.d.ts +85 -0
- package/dist/core/ecs/resume.d.ts.map +1 -0
- package/dist/core/ecs/run_condition.d.cts +81 -0
- package/dist/core/ecs/run_condition.d.ts +81 -0
- package/dist/core/ecs/run_condition.d.ts.map +1 -0
- package/dist/core/ecs/schedule.d.cts +142 -0
- package/dist/core/ecs/schedule.d.ts +142 -0
- package/dist/core/ecs/schedule.d.ts.map +1 -0
- package/dist/core/ecs/snapshot_service.d.cts +94 -0
- package/dist/core/ecs/snapshot_service.d.ts +94 -0
- package/dist/core/ecs/snapshot_service.d.ts.map +1 -0
- package/dist/core/ecs/sparse_store.d.cts +110 -0
- package/dist/core/ecs/sparse_store.d.ts +110 -0
- package/dist/core/ecs/sparse_store.d.ts.map +1 -0
- package/dist/core/ecs/store.d.cts +950 -0
- package/dist/core/ecs/store.d.ts +950 -0
- package/dist/core/ecs/store.d.ts.map +1 -0
- package/dist/core/ecs/store_layout_listener.d.cts +23 -0
- package/dist/core/ecs/store_layout_listener.d.ts +23 -0
- package/dist/core/ecs/store_layout_listener.d.ts.map +1 -0
- package/dist/core/ecs/system.d.cts +250 -0
- package/dist/core/ecs/system.d.ts +250 -0
- package/dist/core/ecs/system.d.ts.map +1 -0
- package/dist/core/ecs/utils/arrays.d.cts +7 -0
- package/dist/{utils → core/ecs/utils}/arrays.d.ts +2 -1
- package/dist/core/ecs/utils/arrays.d.ts.map +1 -0
- package/dist/core/ecs/utils/constants.d.ts +12 -0
- package/dist/core/ecs/utils/constants.d.ts.map +1 -0
- package/dist/core/ecs/utils/error.d.cts +61 -0
- package/dist/core/ecs/utils/error.d.ts +61 -0
- package/dist/core/ecs/utils/error.d.ts.map +1 -0
- package/dist/core/store/action_ring.d.cts +136 -0
- package/dist/core/store/action_ring.d.ts +136 -0
- package/dist/core/store/action_ring.d.ts.map +1 -0
- package/dist/core/store/allocator.d.cts +238 -0
- package/dist/core/store/allocator.d.ts +238 -0
- package/dist/core/store/allocator.d.ts.map +1 -0
- package/dist/core/store/buffer_backed_column.d.cts +69 -0
- package/dist/core/store/buffer_backed_column.d.ts +69 -0
- package/dist/core/store/buffer_backed_column.d.ts.map +1 -0
- package/dist/core/store/column_store.d.cts +273 -0
- package/dist/core/store/column_store.d.ts +273 -0
- package/dist/core/store/column_store.d.ts.map +1 -0
- package/dist/core/store/command_dispatch.d.cts +52 -0
- package/dist/core/store/command_dispatch.d.ts +52 -0
- package/dist/core/store/command_dispatch.d.ts.map +1 -0
- package/dist/core/store/command_ring.d.cts +107 -0
- package/dist/core/store/command_ring.d.ts +107 -0
- package/dist/core/store/command_ring.d.ts.map +1 -0
- package/dist/core/store/descriptor.d.cts +80 -0
- package/dist/core/store/descriptor.d.ts +80 -0
- package/dist/core/store/descriptor.d.ts.map +1 -0
- package/dist/core/store/entity_index.d.cts +108 -0
- package/dist/core/store/entity_index.d.ts +108 -0
- package/dist/core/store/entity_index.d.ts.map +1 -0
- package/dist/core/store/event_ring.d.cts +95 -0
- package/dist/core/store/event_ring.d.ts +95 -0
- package/dist/core/store/event_ring.d.ts.map +1 -0
- package/dist/core/store/extend.d.cts +39 -0
- package/dist/core/store/extend.d.ts +39 -0
- package/dist/core/store/extend.d.ts.map +1 -0
- package/dist/core/store/grow.d.cts +34 -0
- package/dist/core/store/grow.d.ts +34 -0
- package/dist/core/store/grow.d.ts.map +1 -0
- package/dist/core/store/header.d.cts +64 -0
- package/dist/core/store/header.d.ts +64 -0
- package/dist/core/store/header.d.ts.map +1 -0
- package/dist/core/store/index.d.cts +17 -0
- package/dist/core/store/index.d.ts +17 -0
- package/dist/core/store/index.d.ts.map +1 -0
- package/dist/core/store/layout_ops.d.cts +152 -0
- package/dist/core/store/layout_ops.d.ts +152 -0
- package/dist/core/store/layout_ops.d.ts.map +1 -0
- package/dist/core/store/region_table.d.cts +74 -0
- package/dist/core/store/region_table.d.ts +74 -0
- package/dist/core/store/region_table.d.ts.map +1 -0
- package/dist/core/store/snapshot.d.cts +43 -0
- package/dist/core/store/snapshot.d.ts +43 -0
- package/dist/core/store/snapshot.d.ts.map +1 -0
- package/dist/core/store/state_hash.d.cts +38 -0
- package/dist/core/store/state_hash.d.ts +38 -0
- package/dist/core/store/state_hash.d.ts.map +1 -0
- package/dist/core/store/store_regions.d.cts +38 -0
- package/dist/core/store/store_regions.d.ts +38 -0
- package/dist/core/store/store_regions.d.ts.map +1 -0
- package/dist/core/store/vendored_abi/abi.d.cts +43 -0
- package/dist/core/store/vendored_abi/abi.d.ts +43 -0
- package/dist/core/store/vendored_abi/abi.d.ts.map +1 -0
- package/dist/dev_flag.d.cts +17 -0
- package/dist/dev_flag.d.ts +17 -0
- package/dist/dev_flag.d.ts.map +1 -0
- package/dist/extensions/editor/editor.d.cts +170 -0
- package/dist/extensions/editor/editor.d.ts +170 -0
- package/dist/extensions/editor/editor.d.ts.map +1 -0
- package/dist/extensions/editor/field_handle.d.cts +40 -0
- package/dist/extensions/editor/field_handle.d.ts +40 -0
- package/dist/extensions/editor/field_handle.d.ts.map +1 -0
- package/dist/extensions/editor/index.cjs +1 -0
- package/dist/extensions/editor/index.d.cts +21 -0
- package/dist/extensions/editor/index.d.ts +21 -0
- package/dist/extensions/editor/index.d.ts.map +1 -0
- package/dist/extensions/editor/index.js +237 -0
- package/dist/extensions/reactive/ecs_sync.d.cts +214 -0
- package/dist/extensions/reactive/ecs_sync.d.ts +214 -0
- package/dist/extensions/reactive/ecs_sync.d.ts.map +1 -0
- package/dist/extensions/reactive/index.cjs +1 -0
- package/dist/extensions/reactive/index.d.cts +23 -0
- package/dist/extensions/reactive/index.d.ts +23 -0
- package/dist/extensions/reactive/index.d.ts.map +1 -0
- package/dist/extensions/reactive/index.js +215 -0
- package/dist/extensions/solid/index.cjs +1 -0
- package/dist/extensions/solid/index.d.cts +6 -0
- package/dist/extensions/solid/index.d.ts +6 -0
- package/dist/extensions/solid/index.d.ts.map +1 -0
- package/dist/extensions/solid/index.js +36 -0
- package/dist/extensions/solid/kernel_solid.d.cts +45 -0
- package/dist/extensions/solid/kernel_solid.d.ts +45 -0
- package/dist/extensions/solid/kernel_solid.d.ts.map +1 -0
- package/dist/host_commands-BF8QMi3c.cjs +1 -0
- package/dist/host_commands-i4cAeyL5.js +2318 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +66 -0
- package/dist/index.d.ts +65 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7080 -1289
- package/dist/internal.cjs +2 -0
- package/dist/internal.d.cts +20 -0
- package/dist/internal.d.ts +20 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +141 -0
- package/dist/interop-CT-REx0W.cjs +1 -0
- package/dist/interop-CcY6ASQc.js +18 -0
- package/dist/kernel-DgyrLFjW.js +227 -0
- package/dist/kernel-yWV3XnAb.cjs +1 -0
- package/dist/primitives.cjs +1 -0
- package/dist/primitives.d.cts +18 -0
- package/dist/primitives.d.ts +18 -0
- package/dist/primitives.d.ts.map +1 -0
- package/dist/primitives.js +45 -0
- package/dist/reactive/array.d.cts +24 -0
- package/dist/reactive/array.d.ts +24 -0
- package/dist/reactive/array.d.ts.map +1 -0
- package/dist/reactive/index.cjs +1 -0
- package/dist/reactive/index.d.cts +11 -0
- package/dist/reactive/index.d.ts +11 -0
- package/dist/reactive/index.d.ts.map +1 -0
- package/dist/reactive/index.js +18 -0
- package/dist/reactive/interop.d.cts +19 -0
- package/dist/reactive/interop.d.ts +19 -0
- package/dist/reactive/interop.d.ts.map +1 -0
- package/dist/reactive/kernel.d.cts +73 -0
- package/dist/reactive/kernel.d.ts +73 -0
- package/dist/reactive/kernel.d.ts.map +1 -0
- package/dist/reactive/map.d.cts +16 -0
- package/dist/reactive/map.d.ts +16 -0
- package/dist/reactive/map.d.ts.map +1 -0
- package/dist/reactive/shallow.d.cts +11 -0
- package/dist/reactive/shallow.d.ts +11 -0
- package/dist/reactive/shallow.d.ts.map +1 -0
- package/dist/reactive/struct.d.cts +10 -0
- package/dist/reactive/struct.d.ts +10 -0
- package/dist/reactive/struct.d.ts.map +1 -0
- package/dist/shallow-DQ8aG51_.cjs +1 -0
- package/dist/shallow-DfnAm9vG.js +150 -0
- package/dist/shared-BU1Cd40h.js +103 -0
- package/dist/shared-BymrGTyR.cjs +1 -0
- package/dist/shared.cjs +1 -0
- package/dist/shared.d.cts +22 -0
- package/dist/shared.d.ts +22 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +7 -0
- package/dist/topological_sort-BDvEyb9W.cjs +1 -0
- package/dist/topological_sort-DK6EjpWa.js +135 -0
- package/dist/type_primitives/assertions.d.cts +32 -0
- package/dist/type_primitives/assertions.d.ts +25 -9
- package/dist/type_primitives/assertions.d.ts.map +1 -1
- package/dist/type_primitives/binary_heap/binary_heap.d.cts +37 -0
- package/dist/type_primitives/binary_heap/binary_heap.d.ts +6 -2
- package/dist/type_primitives/binary_heap/binary_heap.d.ts.map +1 -1
- package/dist/type_primitives/bitset/bitset.d.cts +54 -0
- package/dist/type_primitives/bitset/bitset.d.ts +16 -4
- package/dist/type_primitives/bitset/bitset.d.ts.map +1 -1
- package/dist/type_primitives/brand.d.cts +23 -0
- package/dist/type_primitives/brand.d.ts +6 -1
- package/dist/type_primitives/brand.d.ts.map +1 -1
- package/dist/type_primitives/error.d.cts +16 -0
- package/dist/type_primitives/error.d.ts +8 -3
- package/dist/type_primitives/error.d.ts.map +1 -1
- package/dist/type_primitives/index.d.cts +13 -0
- package/dist/type_primitives/index.d.ts +12 -9
- package/dist/type_primitives/index.d.ts.map +1 -1
- package/dist/type_primitives/sparse_map/sparse_map.d.cts +30 -0
- package/dist/type_primitives/sparse_map/sparse_map.d.ts +7 -3
- package/dist/type_primitives/sparse_map/sparse_map.d.ts.map +1 -1
- package/dist/type_primitives/sparse_set/sparse_set.d.cts +28 -0
- package/dist/type_primitives/sparse_set/sparse_set.d.ts +4 -0
- package/dist/type_primitives/sparse_set/sparse_set.d.ts.map +1 -1
- package/dist/type_primitives/topological_sort/topological_sort.d.cts +29 -0
- package/dist/type_primitives/topological_sort/topological_sort.d.ts +7 -3
- package/dist/type_primitives/topological_sort/topological_sort.d.ts.map +1 -1
- package/dist/type_primitives/typed_arrays/typed_arrays.d.cts +127 -0
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +53 -16
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts.map +1 -1
- package/dist/typed_arrays-BcXcnzB4.js +258 -0
- package/dist/typed_arrays-D3NmwtCG.cjs +1 -0
- package/dist/utils/error.d.cts +6 -0
- package/dist/utils/error.d.ts +2 -20
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/version.d.cts +10 -0
- package/dist/version.d.ts +10 -0
- package/dist/version.d.ts.map +1 -0
- package/package.json +115 -5
- package/dist/archetype.d.ts +0 -108
- package/dist/archetype.d.ts.map +0 -1
- package/dist/component.d.ts +0 -45
- package/dist/component.d.ts.map +0 -1
- package/dist/ecs.d.ts +0 -104
- package/dist/ecs.d.ts.map +0 -1
- package/dist/entity.d.ts +0 -11
- package/dist/entity.d.ts.map +0 -1
- package/dist/event.d.ts +0 -30
- package/dist/event.d.ts.map +0 -1
- package/dist/query.d.ts +0 -94
- package/dist/query.d.ts.map +0 -1
- package/dist/ref.d.ts +0 -23
- package/dist/ref.d.ts.map +0 -1
- package/dist/resource.d.ts +0 -23
- package/dist/resource.d.ts.map +0 -1
- package/dist/schedule.d.ts +0 -45
- package/dist/schedule.d.ts.map +0 -1
- package/dist/store.d.ts +0 -118
- package/dist/store.d.ts.map +0 -1
- package/dist/system.d.ts +0 -16
- package/dist/system.d.ts.map +0 -1
- package/dist/utils/arrays.d.ts.map +0 -1
- package/dist/utils/constants.d.ts.map +0 -1
- /package/dist/{utils/constants.d.ts → core/ecs/utils/constants.d.cts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/query.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2CK;AAEL,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGzC,OAAO,KAAK,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EAEf,QAAQ,EACR,iBAAiB,EACjB,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,WAAW,EACX,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,UAAU,EACV,MAAM,UAAU,CAAC;AAClB,OAAO,EAAa,KAAK,YAAY,EAAE,KAAK,oBAAoB,EAAE,MA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D;AAED,qBAAa,YAAY,CAAC,IAAI,SAAS,SAAS,YAAY,EAAE;IAC7D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAc;IACrC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAW;gBAE3B,KAAK,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE;IAwBpD,2DAA2D;IACpD,GAAG,CAAC,CAAC,SAAS,YAAY,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC,GAAG,YAAY,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC;IAIhF,yEAAyE;IAClE,OAAO,CAAC,GAAG,KAAK,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC;IAI5D,6DAA6D;IACtD,KAAK,CAAC,GAAG,KAAK,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC;IAI1D,oFAAoF;IAC7E,QAAQ,CAAC,GAAG,IAAI,EAAE,YAAY,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC;IAIrD,OAAO,CAAC,EAAE,EAAE,CAAC,IAAI,EAAE,aAAa,CAAC,IAAI,CAAC,KAAK,IAAI,GAAG,IAAI;IAqD7D;8EAC0E;IAC1E,OAAO,CAAC,uBAAuB;IAS/B;;;mEAG+D;IAC/D,OAAO,CAAC,aAAa;CAyCrB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ComponentSchema } from './component.cjs';
|
|
2
|
+
import { ArchetypeColumnLayout } from './archetype.cjs';
|
|
3
|
+
import { AnyTypedArray, ColumnBacking } from '../../type_primitives/index.cjs';
|
|
4
|
+
/** Maps component schema to scalar get/set properties: { x: number, y: number }. */
|
|
5
|
+
export type ComponentRef<S extends ComponentSchema> = {
|
|
6
|
+
-readonly [K in keyof S]: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Read-only view of a component reference. This is an **advisory** barrier,
|
|
10
|
+
* not a runtime safety boundary: the `readonly` properties block field writes
|
|
11
|
+
* at the type layer, but `createRef` installs working get/set on the shared
|
|
12
|
+
* prototype for both `ref()` and `refRead()`, so a §10c-policed cast can
|
|
13
|
+
* still write through (and would skip the change-tick bump `ref()` performs).
|
|
14
|
+
* Treat it as "I promise I am only reading," enforced by the escape-hatch lint
|
|
15
|
+
* (`bun run lint:escape-hatches`), not by the runtime.
|
|
16
|
+
*/
|
|
17
|
+
export type ReadonlyComponentRef<S extends ComponentSchema> = {
|
|
18
|
+
readonly [K in keyof S]: number;
|
|
19
|
+
};
|
|
20
|
+
/** Minimal column group shape needed by createRef. */
|
|
21
|
+
export interface RefColumnGroup {
|
|
22
|
+
readonly layout: ArchetypeColumnLayout;
|
|
23
|
+
readonly columns: ColumnBacking<AnyTypedArray>[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create a ComponentRef bound to a specific row in a column group.
|
|
27
|
+
* The prototype is built once per column group and cached; subsequent
|
|
28
|
+
* calls for the same group only allocate the lightweight ref object.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createRef<S extends ComponentSchema>(group: RefColumnGroup, row: number): ComponentRef<S>;
|
|
31
|
+
//# sourceMappingURL=ref.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ComponentSchema } from './component.js';
|
|
2
|
+
import { ArchetypeColumnLayout } from './archetype.js';
|
|
3
|
+
import { AnyTypedArray, ColumnBacking } from '../../type_primitives/index.js';
|
|
4
|
+
/** Maps component schema to scalar get/set properties: { x: number, y: number }. */
|
|
5
|
+
export type ComponentRef<S extends ComponentSchema> = {
|
|
6
|
+
-readonly [K in keyof S]: number;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Read-only view of a component reference. This is an **advisory** barrier,
|
|
10
|
+
* not a runtime safety boundary: the `readonly` properties block field writes
|
|
11
|
+
* at the type layer, but `createRef` installs working get/set on the shared
|
|
12
|
+
* prototype for both `ref()` and `refRead()`, so a §10c-policed cast can
|
|
13
|
+
* still write through (and would skip the change-tick bump `ref()` performs).
|
|
14
|
+
* Treat it as "I promise I am only reading," enforced by the escape-hatch lint
|
|
15
|
+
* (`bun run lint:escape-hatches`), not by the runtime.
|
|
16
|
+
*/
|
|
17
|
+
export type ReadonlyComponentRef<S extends ComponentSchema> = {
|
|
18
|
+
readonly [K in keyof S]: number;
|
|
19
|
+
};
|
|
20
|
+
/** Minimal column group shape needed by createRef. */
|
|
21
|
+
export interface RefColumnGroup {
|
|
22
|
+
readonly layout: ArchetypeColumnLayout;
|
|
23
|
+
readonly columns: ColumnBacking<AnyTypedArray>[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create a ComponentRef bound to a specific row in a column group.
|
|
27
|
+
* The prototype is built once per column group and cached; subsequent
|
|
28
|
+
* calls for the same group only allocate the lightweight ref object.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createRef<S extends ComponentSchema>(group: RefColumnGroup, row: number): ComponentRef<S>;
|
|
31
|
+
//# sourceMappingURL=ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ref.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/ref.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BK;AAEL,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE1E,oFAAoF;AACpF,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS,eAAe,IAAI;IACrD,CAAC,UAAU,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM;CAChC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,eAAe,IAAI;IAC7D,QAAQ,EAAE,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM;CAC/B,CAAC;AAMF,sDAAsD;AACtD,MAAM,WAAW,cAAc;IAC9B,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,aAAa,CAAC,EAAE,CAAC;CACjD;AAWD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,eAAe,EAClD,KAAK,EAAE,cAAc,EACrB,GAAG,EAAE,MAAM,GACT,YAAY,CAAC,CAAC,CAAC,CAwBjB"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { Brand } from '../../type_primitives/index.cjs';
|
|
2
|
+
import { EntityID } from './entity.cjs';
|
|
3
|
+
import { SparseComponentDef, SparseComponentStore } from './sparse_store.cjs';
|
|
4
|
+
/** Relation handle id. A separate id space from `ComponentID` and
|
|
5
|
+
* `SparseComponentID` — it indexes the `RelationService` registry. The numeric
|
|
6
|
+
* value is the registration order, stable for the lifetime of the ECS. */
|
|
7
|
+
export type RelationID = Brand<number, "relation_id">;
|
|
8
|
+
declare const __relationBrand: unique symbol;
|
|
9
|
+
/** A relation's registration-time cardinality: `exclusive` = one target per
|
|
10
|
+
* source (re-add replaces), `multi` = a target set per source. */
|
|
11
|
+
export type RelationCardinality = "exclusive" | "multi";
|
|
12
|
+
declare const __relationCardinality: unique symbol;
|
|
13
|
+
export type RelationDef<C extends RelationCardinality = RelationCardinality> = RelationID & {
|
|
14
|
+
readonly [__relationBrand]: "relation";
|
|
15
|
+
readonly [__relationCardinality]?: [C];
|
|
16
|
+
};
|
|
17
|
+
/** Access sentinel for the `(*, T)` wildcard query iteration
|
|
18
|
+
* (`Query.forEachRelatedTo`, #579). A `(*, T)` term reads **every** registered
|
|
19
|
+
* relation's reverse index to find sources of `T`, so it can't name a specific
|
|
20
|
+
* relation in `relationReads` the way `withRelation(R)` (`(R, *)`) can. A
|
|
21
|
+
* system that iterates a `(*, T)` wildcard lists `ANY_RELATION` in `relationReads`
|
|
22
|
+
* instead; `accessCheck.checkRelationReadAny` honors it. The numeric value is a
|
|
23
|
+
* reserved sentinel far past any real registration-order relation id (relations are
|
|
24
|
+
* minted from 0 upward), so it can never collide with a registered relation. */
|
|
25
|
+
export declare const ANY_RELATION: RelationDef;
|
|
26
|
+
/** Cleanup policy applied to a relation's **sources** when one of its
|
|
27
|
+
* **targets** is destroyed (#473). Chosen per-relation at registration, run at
|
|
28
|
+
* destroy-flush (and the immediate-destroy path) off the reverse index:
|
|
29
|
+
*
|
|
30
|
+
* - **`delete`** — cascade: destroy every source of the dead target too,
|
|
31
|
+
* recursively for chains/trees (the canonical ChildOf case).
|
|
32
|
+
* - **`clear`** — remove the relation from every source; the sources survive.
|
|
33
|
+
* - **`orphan`** — leave the link intact but dangling. Reads stay safe (the
|
|
34
|
+
* reverse index is `EntityID`-keyed, so the dead handle never aliases a
|
|
35
|
+
* recycled slot); `targetOf` returns a dead handle until the source
|
|
36
|
+
* re-targets or is removed. This is the pre-#473 behaviour and the default.
|
|
37
|
+
*/
|
|
38
|
+
export type OnDeleteTarget = "delete" | "clear" | "orphan";
|
|
39
|
+
/** Default on-target-delete policy: leave the link dangling (pre-#473
|
|
40
|
+
* behaviour, zero change for callers that don't opt in). */
|
|
41
|
+
export declare const DEFAULT_ON_DELETE_TARGET: OnDeleteTarget;
|
|
42
|
+
/** Registration options. `exclusive` (one target per source) is the default;
|
|
43
|
+
* pass `{ multi: true }` for a multi-target relation. The two are mutually
|
|
44
|
+
* exclusive — the union makes `{ exclusive: true, multi: true }` a compile
|
|
45
|
+
* error (it also throws at runtime, for JS callers). `onDeleteTarget` selects
|
|
46
|
+
* the cleanup policy applied to sources when a target is destroyed (default
|
|
47
|
+
* `orphan`). */
|
|
48
|
+
export type RelationOptions = {
|
|
49
|
+
readonly exclusive?: true;
|
|
50
|
+
readonly multi?: false;
|
|
51
|
+
readonly onDeleteTarget?: OnDeleteTarget;
|
|
52
|
+
} | {
|
|
53
|
+
readonly multi: true;
|
|
54
|
+
readonly exclusive?: false;
|
|
55
|
+
readonly onDeleteTarget?: OnDeleteTarget;
|
|
56
|
+
};
|
|
57
|
+
/** Field name carrying the target `EntityID` on an exclusive relation's backing
|
|
58
|
+
* sparse component. Field 0 of a single-field schema. */
|
|
59
|
+
export declare const RELATION_TARGET_FIELD = "target";
|
|
60
|
+
/** Receives one canonical `(source index, sorted targets)` set during a fold
|
|
61
|
+
* over a multi relation's forward sets. Targets are ascending by id; empty sets
|
|
62
|
+
* are never yielded (see `forEachCanonicalTargetSet`). */
|
|
63
|
+
export type CanonicalTargetSetFn = (sourceIndex: number, targets: readonly EntityID[]) => void;
|
|
64
|
+
/** Receives one canonical `(source, target)` pair during a fold over a
|
|
65
|
+
* relation's forward links. Sources ascend by entity index, each source's
|
|
66
|
+
* targets ascend by id — the #470 determinism order. */
|
|
67
|
+
export type CanonicalPairFn = (source: EntityID, target: EntityID) => void;
|
|
68
|
+
/** Maps a source entity **index** to its full `EntityID` (generation from the
|
|
69
|
+
* live slot). Supplied by `Store`, which owns entity generations. */
|
|
70
|
+
export type MakeSourceID = (index: number) => EntityID;
|
|
71
|
+
/** One relation's derived side state. **Abstract over cardinality (#498):** the
|
|
72
|
+
* base owns the cardinality-agnostic **reverse index** (target → sources, keyed
|
|
73
|
+
* by full `EntityID` so a recycled slot can't alias a dead target's sources) and
|
|
74
|
+
* a handle on the backing `SparseComponentStore`; the forward representation and
|
|
75
|
+
* its sparse interaction are owned by the concrete `ExclusiveRelationStore` /
|
|
76
|
+
* `MultiRelationStore` (built by `makeRelationStore`).
|
|
77
|
+
*
|
|
78
|
+
* The registry level (`Store` + `RelationService`) owns what is genuinely its
|
|
79
|
+
* own — entity liveness, registration, and destroy orchestration — and drives
|
|
80
|
+
* a relation through the virtual `link` /
|
|
81
|
+
* `unlink` / `purgeSource` / `forEachCanonicalPair` / … without ever
|
|
82
|
+
* branching on cardinality. Each cardinality keeps forward link + reverse index
|
|
83
|
+
* + sparse membership in lockstep inside one method on one class, so the
|
|
84
|
+
* lockstep can't be broken by missing a scattered `if (rs.exclusive)` site. */
|
|
85
|
+
export declare abstract class RelationStore {
|
|
86
|
+
/** `true` → one target per source (target in the sparse field); `false` →
|
|
87
|
+
* a set of targets per source. The cardinality discriminant survives as a
|
|
88
|
+
* field because it is part of the snapshot header and the traversal/`targetOf`
|
|
89
|
+
* mode guards — but the forward *mechanics* are virtual, not branched on it. */
|
|
90
|
+
readonly exclusive: boolean;
|
|
91
|
+
/** Backing sparse component def: `{ target: f64 }` when exclusive, a tag when
|
|
92
|
+
* multi. Carries membership (and the target, when exclusive). */
|
|
93
|
+
readonly sparse: SparseComponentDef;
|
|
94
|
+
/** Cleanup policy applied to this relation's sources when a target is
|
|
95
|
+
* destroyed (#473). `orphan` (the default) is a no-op — the link dangles
|
|
96
|
+
* safely. `Store` reads this at destroy-flush off `sourcesOf`. */
|
|
97
|
+
readonly onDeleteTarget: OnDeleteTarget;
|
|
98
|
+
/** The backing sparse store instance. Owned for registration/liveness by
|
|
99
|
+
* `Store`, but the relation drives the forward/membership rows on it directly
|
|
100
|
+
* — that is the cardinality interaction this class now encapsulates (#498). */
|
|
101
|
+
protected readonly _store: SparseComponentStore;
|
|
102
|
+
/** target `EntityID` → set of source `EntityID`s. Keyed by the full id, not
|
|
103
|
+
* the index, so a recycled target slot can't alias a dead target's sources.
|
|
104
|
+
* An entry is dropped the moment its set empties (`unlinkReverse`). */
|
|
105
|
+
private readonly _reverse;
|
|
106
|
+
constructor(exclusive: boolean, sparse: SparseComponentDef, store: SparseComponentStore, onDeleteTarget: OnDeleteTarget);
|
|
107
|
+
/** Record that `src` points at `tgt` in the reverse index. */
|
|
108
|
+
protected linkReverse(tgt: EntityID, src: EntityID): void;
|
|
109
|
+
/** Drop the `src → tgt` edge from the reverse index, removing the target's
|
|
110
|
+
* entry entirely once its last source is gone (so a dead-target key doesn't
|
|
111
|
+
* linger with an empty set). */
|
|
112
|
+
protected unlinkReverse(tgt: EntityID, src: EntityID): void;
|
|
113
|
+
/** Drop every reverse-index entry whose **target** is no longer alive,
|
|
114
|
+
* returning the count dropped (#491). The `orphan` policy intentionally
|
|
115
|
+
* leaves a destroyed target's reverse entry intact (the link dangles
|
|
116
|
+
* safely), so a long-lived source that orphan-points at a stream of
|
|
117
|
+
* short-lived targets and never re-targets/dies accumulates dead-target keys
|
|
118
|
+
* without bound. This is the reclaim primitive behind `Store.compactRelations`
|
|
119
|
+
* — a cold path the host calls at scene/snapshot boundaries. It is
|
|
120
|
+
* cardinality-free (reverse-index only), so it lives on the base unchanged.
|
|
121
|
+
*
|
|
122
|
+
* Pure index reclaim: the **forward** links (the exclusive sparse target
|
|
123
|
+
* field, the multi forward set) are left untouched, so `targetOf` /
|
|
124
|
+
* `targetsOf` still return the dangling dead handle exactly as `orphan`
|
|
125
|
+
* promises. The reverse index is derived, so dropping a dead-target entry
|
|
126
|
+
* changes nothing observable except `sourcesOf` on that dead handle (which
|
|
127
|
+
* goes from the dangling sources to `[]` — meaningless either way, the target
|
|
128
|
+
* is gone) and is faithfully rebuilt by snapshot/restore from the surviving
|
|
129
|
+
* forward links. Only the **target** role can leak here: a destroyed *source*
|
|
130
|
+
* is already unlinked from every reverse set by `purgeSource`, so a live
|
|
131
|
+
* target's set never holds a dead source. `isAlive` is supplied by `Store`,
|
|
132
|
+
* which owns entity liveness. Deleting during `Map` key iteration is
|
|
133
|
+
* well-defined — already-visited and not-yet-reached keys are unaffected. */
|
|
134
|
+
pruneDeadReverse(isAlive: (id: EntityID) => boolean): number;
|
|
135
|
+
/** Sources that point at `tgt`, ascending by id (deterministic, cold-path
|
|
136
|
+
* sort) — empty when none. */
|
|
137
|
+
sourcesOf(tgt: EntityID): EntityID[];
|
|
138
|
+
/** Drop every derived side index — the reverse index and (for multi) the
|
|
139
|
+
* forward target sets. Restore path only (`restoreRelations`): the side
|
|
140
|
+
* indices are rebuilt from scratch, so they're cleared first to stay
|
|
141
|
+
* idempotent when restoring into a dirty world. The backing sparse store is
|
|
142
|
+
* cleared separately by `restoreSparseStores`. */
|
|
143
|
+
resetIndices(): void;
|
|
144
|
+
/** Clear this relation's forward representation (multi: the side map;
|
|
145
|
+
* exclusive: nothing — its forward links live in the sparse store, cleared by
|
|
146
|
+
* `restoreSparseStores`). */
|
|
147
|
+
protected abstract _resetForward(): void;
|
|
148
|
+
/** Add a `(R, tgt)` link from `src`, keeping forward link + membership +
|
|
149
|
+
* reverse index in lockstep. Exclusive: replaces any existing target
|
|
150
|
+
* (idempotent if `tgt` is already the target). Multi: adds to the set
|
|
151
|
+
* (idempotent on a duplicate), establishing the membership tag on the first
|
|
152
|
+
* target. `src` must be live — `Store` checks before delegating (#495). */
|
|
153
|
+
abstract link(src: EntityID, tgt: EntityID): void;
|
|
154
|
+
/** Remove `(R, tgt)` from `src` — or, when `tgt` is omitted, every target of
|
|
155
|
+
* `src` — keeping forward link + membership + reverse index in lockstep. A
|
|
156
|
+
* no-op when the link isn't present. */
|
|
157
|
+
abstract unlink(src: EntityID, tgt?: EntityID): void;
|
|
158
|
+
/** Purge a destroyed **source**: drop its forward link(s) and unlink it from
|
|
159
|
+
* every target's reverse set, but leave the sparse **membership** row alone —
|
|
160
|
+
* `Store._purgeSparse` drops that (for every store) right after, so this
|
|
161
|
+
* runs first and must not double-remove. */
|
|
162
|
+
abstract purgeSource(src: EntityID): void;
|
|
163
|
+
/** The single target of source `index`, or `undefined`. Exclusive reads the
|
|
164
|
+
* sparse field; multi has no single target and returns `undefined` (matching
|
|
165
|
+
* the production `targetOf`-on-multi read, which the `DEV` guard rejects). */
|
|
166
|
+
abstract singleTarget(index: number): EntityID | undefined;
|
|
167
|
+
/** All targets of source `index`, ascending by id — one or zero for
|
|
168
|
+
* exclusive, the full sorted set for multi. The symmetric counterpart to
|
|
169
|
+
* `sourcesOf` (#498 item 4). */
|
|
170
|
+
abstract targetsOf(index: number): EntityID[];
|
|
171
|
+
/** Whether source `index` holds any target under this relation (sparse
|
|
172
|
+
* membership). */
|
|
173
|
+
abstract has(index: number): boolean;
|
|
174
|
+
/** Fold `cb` over this relation's **multi** forward target sets in canonical
|
|
175
|
+
* order (sources ascending by index, each source's targets ascending by id),
|
|
176
|
+
* skipping empty sets. The single source of truth for the canonical multi
|
|
177
|
+
* traversal shared by `stateHash`, `snapshotRelations`, and `pairsOf`
|
|
178
|
+
* (#498 item 1). Exclusive relations contribute via the sparse store, so this
|
|
179
|
+
* is a no-op for them. */
|
|
180
|
+
abstract forEachCanonicalTargetSet(cb: CanonicalTargetSetFn): void;
|
|
181
|
+
/** Fold `cb` over every `(source, target)` pair of this relation in canonical
|
|
182
|
+
* order — the `(R, *)` wildcard drive order (#472). `makeId` maps a source
|
|
183
|
+
* index to its full `EntityID`. Exclusive rides the backing store's
|
|
184
|
+
* `canonicalIndices`; multi rides `forEachCanonicalTargetSet`. */
|
|
185
|
+
abstract forEachCanonicalPair(makeId: MakeSourceID, cb: CanonicalPairFn): void;
|
|
186
|
+
/** Rebuild the reverse index from the forward links after a restore.
|
|
187
|
+
* Exclusive reads it back from the just-restored sparse target field (the
|
|
188
|
+
* reverse index is never serialized); multi already rebuilt its reverse edges
|
|
189
|
+
* in `restoreAddTarget`, so this is a no-op for it. `makeId` maps a source
|
|
190
|
+
* index to its full `EntityID`. */
|
|
191
|
+
abstract rebuildReverseFromForward(makeId: MakeSourceID): void;
|
|
192
|
+
/** Restore one decoded multi forward edge `(source index → tgt)` plus its
|
|
193
|
+
* reverse edge (the source's full `EntityID` is `src`). Multi only — the
|
|
194
|
+
* snapshot header guards exclusive relations out before this is reached, so
|
|
195
|
+
* the exclusive override throws defensively. */
|
|
196
|
+
abstract restoreAddTarget(index: number, tgt: EntityID, src: EntityID): void;
|
|
197
|
+
}
|
|
198
|
+
/** Build the right `RelationStore` for a cardinality. The only construction
|
|
199
|
+
* site is `Store.registerRelation`, which resolves the backing sparse store and
|
|
200
|
+
* hands it in so the relation can drive forward/membership rows directly. */
|
|
201
|
+
export declare function makeRelationStore(exclusive: boolean, sparse: SparseComponentDef, store: SparseComponentStore, onDeleteTarget: OnDeleteTarget): RelationStore;
|
|
202
|
+
/** Serialize the relation side data that does **not** live in the sparse store
|
|
203
|
+
* — i.e. each **multi** relation's forward target sets (`Map<source index,
|
|
204
|
+
* Set<target>>`). Exclusive relations store their target in the backing sparse
|
|
205
|
+
* field, so they ride `snapshotSparseStores` and contribute only a header
|
|
206
|
+
* here. The reverse index is fully derivable (from the sparse store for
|
|
207
|
+
* exclusive, from these sets for multi), so it is never serialized — it is
|
|
208
|
+
* rebuilt by `restoreRelations` + the caller's exclusive-reverse pass.
|
|
209
|
+
*
|
|
210
|
+
* Members are emitted in canonical order (sources ascending by entity index,
|
|
211
|
+
* each source's targets ascending by id) so the bytes are independent of
|
|
212
|
+
* add/remove history — the same byte-level determinism invariant the sparse
|
|
213
|
+
* snapshot holds (#470). Layout (integers little-endian):
|
|
214
|
+
*
|
|
215
|
+
* u32 relationCount
|
|
216
|
+
* repeat relationCount times (registration / id order):
|
|
217
|
+
* u32 isMulti
|
|
218
|
+
* if multi:
|
|
219
|
+
* u32 sourceCount
|
|
220
|
+
* repeat sourceCount times (ascending source index):
|
|
221
|
+
* u32 sourceIndex
|
|
222
|
+
* u32 targetCount
|
|
223
|
+
* f64 × targetCount (target EntityIDs, ascending) */
|
|
224
|
+
export declare function snapshotRelations(relations: readonly RelationStore[]): Uint8Array;
|
|
225
|
+
/** Rebuild every relation's side indices from a `snapshotRelations` buffer and
|
|
226
|
+
* the already-restored sparse stores. Each relation's indices are reset first
|
|
227
|
+
* (idempotent into a dirty world), then:
|
|
228
|
+
*
|
|
229
|
+
* - **multi** — forward target sets and their reverse edges are rebuilt from
|
|
230
|
+
* `bytes` (the sets aren't in the sparse store, so the bytes are the only
|
|
231
|
+
* source). `makeId` maps a source entity index to its full `EntityID`
|
|
232
|
+
* (generation from the live slot) so reverse edges key correctly.
|
|
233
|
+
* - **exclusive** — only the reset happens here; the reverse index is rebuilt
|
|
234
|
+
* by the caller from the backing sparse store (which already round-tripped
|
|
235
|
+
* through `restoreSparseStores`), since this function can't read it.
|
|
236
|
+
*
|
|
237
|
+
* Throws `SparseRestoreError` on any shape mismatch (relation count, an
|
|
238
|
+
* exclusive/multi flag that disagrees with the registered relation, a multi
|
|
239
|
+
* source index past `MAX_INDEX`, or a truncated / over-long buffer) rather than
|
|
240
|
+
* silently building a corrupt index. */
|
|
241
|
+
export declare function restoreRelations(relations: readonly RelationStore[], bytes: Uint8Array, makeId: (index: number) => EntityID): void;
|
|
242
|
+
export {};
|
|
243
|
+
//# sourceMappingURL=relation.d.ts.map
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { Brand } from '../../type_primitives/index.js';
|
|
2
|
+
import { EntityID } from './entity.js';
|
|
3
|
+
import { SparseComponentDef, SparseComponentStore } from './sparse_store.js';
|
|
4
|
+
/** Relation handle id. A separate id space from `ComponentID` and
|
|
5
|
+
* `SparseComponentID` — it indexes the `RelationService` registry. The numeric
|
|
6
|
+
* value is the registration order, stable for the lifetime of the ECS. */
|
|
7
|
+
export type RelationID = Brand<number, "relation_id">;
|
|
8
|
+
declare const __relationBrand: unique symbol;
|
|
9
|
+
/** A relation's registration-time cardinality: `exclusive` = one target per
|
|
10
|
+
* source (re-add replaces), `multi` = a target set per source. */
|
|
11
|
+
export type RelationCardinality = "exclusive" | "multi";
|
|
12
|
+
declare const __relationCardinality: unique symbol;
|
|
13
|
+
export type RelationDef<C extends RelationCardinality = RelationCardinality> = RelationID & {
|
|
14
|
+
readonly [__relationBrand]: "relation";
|
|
15
|
+
readonly [__relationCardinality]?: [C];
|
|
16
|
+
};
|
|
17
|
+
/** Access sentinel for the `(*, T)` wildcard query iteration
|
|
18
|
+
* (`Query.forEachRelatedTo`, #579). A `(*, T)` term reads **every** registered
|
|
19
|
+
* relation's reverse index to find sources of `T`, so it can't name a specific
|
|
20
|
+
* relation in `relationReads` the way `withRelation(R)` (`(R, *)`) can. A
|
|
21
|
+
* system that iterates a `(*, T)` wildcard lists `ANY_RELATION` in `relationReads`
|
|
22
|
+
* instead; `accessCheck.checkRelationReadAny` honors it. The numeric value is a
|
|
23
|
+
* reserved sentinel far past any real registration-order relation id (relations are
|
|
24
|
+
* minted from 0 upward), so it can never collide with a registered relation. */
|
|
25
|
+
export declare const ANY_RELATION: RelationDef;
|
|
26
|
+
/** Cleanup policy applied to a relation's **sources** when one of its
|
|
27
|
+
* **targets** is destroyed (#473). Chosen per-relation at registration, run at
|
|
28
|
+
* destroy-flush (and the immediate-destroy path) off the reverse index:
|
|
29
|
+
*
|
|
30
|
+
* - **`delete`** — cascade: destroy every source of the dead target too,
|
|
31
|
+
* recursively for chains/trees (the canonical ChildOf case).
|
|
32
|
+
* - **`clear`** — remove the relation from every source; the sources survive.
|
|
33
|
+
* - **`orphan`** — leave the link intact but dangling. Reads stay safe (the
|
|
34
|
+
* reverse index is `EntityID`-keyed, so the dead handle never aliases a
|
|
35
|
+
* recycled slot); `targetOf` returns a dead handle until the source
|
|
36
|
+
* re-targets or is removed. This is the pre-#473 behaviour and the default.
|
|
37
|
+
*/
|
|
38
|
+
export type OnDeleteTarget = "delete" | "clear" | "orphan";
|
|
39
|
+
/** Default on-target-delete policy: leave the link dangling (pre-#473
|
|
40
|
+
* behaviour, zero change for callers that don't opt in). */
|
|
41
|
+
export declare const DEFAULT_ON_DELETE_TARGET: OnDeleteTarget;
|
|
42
|
+
/** Registration options. `exclusive` (one target per source) is the default;
|
|
43
|
+
* pass `{ multi: true }` for a multi-target relation. The two are mutually
|
|
44
|
+
* exclusive — the union makes `{ exclusive: true, multi: true }` a compile
|
|
45
|
+
* error (it also throws at runtime, for JS callers). `onDeleteTarget` selects
|
|
46
|
+
* the cleanup policy applied to sources when a target is destroyed (default
|
|
47
|
+
* `orphan`). */
|
|
48
|
+
export type RelationOptions = {
|
|
49
|
+
readonly exclusive?: true;
|
|
50
|
+
readonly multi?: false;
|
|
51
|
+
readonly onDeleteTarget?: OnDeleteTarget;
|
|
52
|
+
} | {
|
|
53
|
+
readonly multi: true;
|
|
54
|
+
readonly exclusive?: false;
|
|
55
|
+
readonly onDeleteTarget?: OnDeleteTarget;
|
|
56
|
+
};
|
|
57
|
+
/** Field name carrying the target `EntityID` on an exclusive relation's backing
|
|
58
|
+
* sparse component. Field 0 of a single-field schema. */
|
|
59
|
+
export declare const RELATION_TARGET_FIELD = "target";
|
|
60
|
+
/** Receives one canonical `(source index, sorted targets)` set during a fold
|
|
61
|
+
* over a multi relation's forward sets. Targets are ascending by id; empty sets
|
|
62
|
+
* are never yielded (see `forEachCanonicalTargetSet`). */
|
|
63
|
+
export type CanonicalTargetSetFn = (sourceIndex: number, targets: readonly EntityID[]) => void;
|
|
64
|
+
/** Receives one canonical `(source, target)` pair during a fold over a
|
|
65
|
+
* relation's forward links. Sources ascend by entity index, each source's
|
|
66
|
+
* targets ascend by id — the #470 determinism order. */
|
|
67
|
+
export type CanonicalPairFn = (source: EntityID, target: EntityID) => void;
|
|
68
|
+
/** Maps a source entity **index** to its full `EntityID` (generation from the
|
|
69
|
+
* live slot). Supplied by `Store`, which owns entity generations. */
|
|
70
|
+
export type MakeSourceID = (index: number) => EntityID;
|
|
71
|
+
/** One relation's derived side state. **Abstract over cardinality (#498):** the
|
|
72
|
+
* base owns the cardinality-agnostic **reverse index** (target → sources, keyed
|
|
73
|
+
* by full `EntityID` so a recycled slot can't alias a dead target's sources) and
|
|
74
|
+
* a handle on the backing `SparseComponentStore`; the forward representation and
|
|
75
|
+
* its sparse interaction are owned by the concrete `ExclusiveRelationStore` /
|
|
76
|
+
* `MultiRelationStore` (built by `makeRelationStore`).
|
|
77
|
+
*
|
|
78
|
+
* The registry level (`Store` + `RelationService`) owns what is genuinely its
|
|
79
|
+
* own — entity liveness, registration, and destroy orchestration — and drives
|
|
80
|
+
* a relation through the virtual `link` /
|
|
81
|
+
* `unlink` / `purgeSource` / `forEachCanonicalPair` / … without ever
|
|
82
|
+
* branching on cardinality. Each cardinality keeps forward link + reverse index
|
|
83
|
+
* + sparse membership in lockstep inside one method on one class, so the
|
|
84
|
+
* lockstep can't be broken by missing a scattered `if (rs.exclusive)` site. */
|
|
85
|
+
export declare abstract class RelationStore {
|
|
86
|
+
/** `true` → one target per source (target in the sparse field); `false` →
|
|
87
|
+
* a set of targets per source. The cardinality discriminant survives as a
|
|
88
|
+
* field because it is part of the snapshot header and the traversal/`targetOf`
|
|
89
|
+
* mode guards — but the forward *mechanics* are virtual, not branched on it. */
|
|
90
|
+
readonly exclusive: boolean;
|
|
91
|
+
/** Backing sparse component def: `{ target: f64 }` when exclusive, a tag when
|
|
92
|
+
* multi. Carries membership (and the target, when exclusive). */
|
|
93
|
+
readonly sparse: SparseComponentDef;
|
|
94
|
+
/** Cleanup policy applied to this relation's sources when a target is
|
|
95
|
+
* destroyed (#473). `orphan` (the default) is a no-op — the link dangles
|
|
96
|
+
* safely. `Store` reads this at destroy-flush off `sourcesOf`. */
|
|
97
|
+
readonly onDeleteTarget: OnDeleteTarget;
|
|
98
|
+
/** The backing sparse store instance. Owned for registration/liveness by
|
|
99
|
+
* `Store`, but the relation drives the forward/membership rows on it directly
|
|
100
|
+
* — that is the cardinality interaction this class now encapsulates (#498). */
|
|
101
|
+
protected readonly _store: SparseComponentStore;
|
|
102
|
+
/** target `EntityID` → set of source `EntityID`s. Keyed by the full id, not
|
|
103
|
+
* the index, so a recycled target slot can't alias a dead target's sources.
|
|
104
|
+
* An entry is dropped the moment its set empties (`unlinkReverse`). */
|
|
105
|
+
private readonly _reverse;
|
|
106
|
+
constructor(exclusive: boolean, sparse: SparseComponentDef, store: SparseComponentStore, onDeleteTarget: OnDeleteTarget);
|
|
107
|
+
/** Record that `src` points at `tgt` in the reverse index. */
|
|
108
|
+
protected linkReverse(tgt: EntityID, src: EntityID): void;
|
|
109
|
+
/** Drop the `src → tgt` edge from the reverse index, removing the target's
|
|
110
|
+
* entry entirely once its last source is gone (so a dead-target key doesn't
|
|
111
|
+
* linger with an empty set). */
|
|
112
|
+
protected unlinkReverse(tgt: EntityID, src: EntityID): void;
|
|
113
|
+
/** Drop every reverse-index entry whose **target** is no longer alive,
|
|
114
|
+
* returning the count dropped (#491). The `orphan` policy intentionally
|
|
115
|
+
* leaves a destroyed target's reverse entry intact (the link dangles
|
|
116
|
+
* safely), so a long-lived source that orphan-points at a stream of
|
|
117
|
+
* short-lived targets and never re-targets/dies accumulates dead-target keys
|
|
118
|
+
* without bound. This is the reclaim primitive behind `Store.compactRelations`
|
|
119
|
+
* — a cold path the host calls at scene/snapshot boundaries. It is
|
|
120
|
+
* cardinality-free (reverse-index only), so it lives on the base unchanged.
|
|
121
|
+
*
|
|
122
|
+
* Pure index reclaim: the **forward** links (the exclusive sparse target
|
|
123
|
+
* field, the multi forward set) are left untouched, so `targetOf` /
|
|
124
|
+
* `targetsOf` still return the dangling dead handle exactly as `orphan`
|
|
125
|
+
* promises. The reverse index is derived, so dropping a dead-target entry
|
|
126
|
+
* changes nothing observable except `sourcesOf` on that dead handle (which
|
|
127
|
+
* goes from the dangling sources to `[]` — meaningless either way, the target
|
|
128
|
+
* is gone) and is faithfully rebuilt by snapshot/restore from the surviving
|
|
129
|
+
* forward links. Only the **target** role can leak here: a destroyed *source*
|
|
130
|
+
* is already unlinked from every reverse set by `purgeSource`, so a live
|
|
131
|
+
* target's set never holds a dead source. `isAlive` is supplied by `Store`,
|
|
132
|
+
* which owns entity liveness. Deleting during `Map` key iteration is
|
|
133
|
+
* well-defined — already-visited and not-yet-reached keys are unaffected. */
|
|
134
|
+
pruneDeadReverse(isAlive: (id: EntityID) => boolean): number;
|
|
135
|
+
/** Sources that point at `tgt`, ascending by id (deterministic, cold-path
|
|
136
|
+
* sort) — empty when none. */
|
|
137
|
+
sourcesOf(tgt: EntityID): EntityID[];
|
|
138
|
+
/** Drop every derived side index — the reverse index and (for multi) the
|
|
139
|
+
* forward target sets. Restore path only (`restoreRelations`): the side
|
|
140
|
+
* indices are rebuilt from scratch, so they're cleared first to stay
|
|
141
|
+
* idempotent when restoring into a dirty world. The backing sparse store is
|
|
142
|
+
* cleared separately by `restoreSparseStores`. */
|
|
143
|
+
resetIndices(): void;
|
|
144
|
+
/** Clear this relation's forward representation (multi: the side map;
|
|
145
|
+
* exclusive: nothing — its forward links live in the sparse store, cleared by
|
|
146
|
+
* `restoreSparseStores`). */
|
|
147
|
+
protected abstract _resetForward(): void;
|
|
148
|
+
/** Add a `(R, tgt)` link from `src`, keeping forward link + membership +
|
|
149
|
+
* reverse index in lockstep. Exclusive: replaces any existing target
|
|
150
|
+
* (idempotent if `tgt` is already the target). Multi: adds to the set
|
|
151
|
+
* (idempotent on a duplicate), establishing the membership tag on the first
|
|
152
|
+
* target. `src` must be live — `Store` checks before delegating (#495). */
|
|
153
|
+
abstract link(src: EntityID, tgt: EntityID): void;
|
|
154
|
+
/** Remove `(R, tgt)` from `src` — or, when `tgt` is omitted, every target of
|
|
155
|
+
* `src` — keeping forward link + membership + reverse index in lockstep. A
|
|
156
|
+
* no-op when the link isn't present. */
|
|
157
|
+
abstract unlink(src: EntityID, tgt?: EntityID): void;
|
|
158
|
+
/** Purge a destroyed **source**: drop its forward link(s) and unlink it from
|
|
159
|
+
* every target's reverse set, but leave the sparse **membership** row alone —
|
|
160
|
+
* `Store._purgeSparse` drops that (for every store) right after, so this
|
|
161
|
+
* runs first and must not double-remove. */
|
|
162
|
+
abstract purgeSource(src: EntityID): void;
|
|
163
|
+
/** The single target of source `index`, or `undefined`. Exclusive reads the
|
|
164
|
+
* sparse field; multi has no single target and returns `undefined` (matching
|
|
165
|
+
* the production `targetOf`-on-multi read, which the `DEV` guard rejects). */
|
|
166
|
+
abstract singleTarget(index: number): EntityID | undefined;
|
|
167
|
+
/** All targets of source `index`, ascending by id — one or zero for
|
|
168
|
+
* exclusive, the full sorted set for multi. The symmetric counterpart to
|
|
169
|
+
* `sourcesOf` (#498 item 4). */
|
|
170
|
+
abstract targetsOf(index: number): EntityID[];
|
|
171
|
+
/** Whether source `index` holds any target under this relation (sparse
|
|
172
|
+
* membership). */
|
|
173
|
+
abstract has(index: number): boolean;
|
|
174
|
+
/** Fold `cb` over this relation's **multi** forward target sets in canonical
|
|
175
|
+
* order (sources ascending by index, each source's targets ascending by id),
|
|
176
|
+
* skipping empty sets. The single source of truth for the canonical multi
|
|
177
|
+
* traversal shared by `stateHash`, `snapshotRelations`, and `pairsOf`
|
|
178
|
+
* (#498 item 1). Exclusive relations contribute via the sparse store, so this
|
|
179
|
+
* is a no-op for them. */
|
|
180
|
+
abstract forEachCanonicalTargetSet(cb: CanonicalTargetSetFn): void;
|
|
181
|
+
/** Fold `cb` over every `(source, target)` pair of this relation in canonical
|
|
182
|
+
* order — the `(R, *)` wildcard drive order (#472). `makeId` maps a source
|
|
183
|
+
* index to its full `EntityID`. Exclusive rides the backing store's
|
|
184
|
+
* `canonicalIndices`; multi rides `forEachCanonicalTargetSet`. */
|
|
185
|
+
abstract forEachCanonicalPair(makeId: MakeSourceID, cb: CanonicalPairFn): void;
|
|
186
|
+
/** Rebuild the reverse index from the forward links after a restore.
|
|
187
|
+
* Exclusive reads it back from the just-restored sparse target field (the
|
|
188
|
+
* reverse index is never serialized); multi already rebuilt its reverse edges
|
|
189
|
+
* in `restoreAddTarget`, so this is a no-op for it. `makeId` maps a source
|
|
190
|
+
* index to its full `EntityID`. */
|
|
191
|
+
abstract rebuildReverseFromForward(makeId: MakeSourceID): void;
|
|
192
|
+
/** Restore one decoded multi forward edge `(source index → tgt)` plus its
|
|
193
|
+
* reverse edge (the source's full `EntityID` is `src`). Multi only — the
|
|
194
|
+
* snapshot header guards exclusive relations out before this is reached, so
|
|
195
|
+
* the exclusive override throws defensively. */
|
|
196
|
+
abstract restoreAddTarget(index: number, tgt: EntityID, src: EntityID): void;
|
|
197
|
+
}
|
|
198
|
+
/** Build the right `RelationStore` for a cardinality. The only construction
|
|
199
|
+
* site is `Store.registerRelation`, which resolves the backing sparse store and
|
|
200
|
+
* hands it in so the relation can drive forward/membership rows directly. */
|
|
201
|
+
export declare function makeRelationStore(exclusive: boolean, sparse: SparseComponentDef, store: SparseComponentStore, onDeleteTarget: OnDeleteTarget): RelationStore;
|
|
202
|
+
/** Serialize the relation side data that does **not** live in the sparse store
|
|
203
|
+
* — i.e. each **multi** relation's forward target sets (`Map<source index,
|
|
204
|
+
* Set<target>>`). Exclusive relations store their target in the backing sparse
|
|
205
|
+
* field, so they ride `snapshotSparseStores` and contribute only a header
|
|
206
|
+
* here. The reverse index is fully derivable (from the sparse store for
|
|
207
|
+
* exclusive, from these sets for multi), so it is never serialized — it is
|
|
208
|
+
* rebuilt by `restoreRelations` + the caller's exclusive-reverse pass.
|
|
209
|
+
*
|
|
210
|
+
* Members are emitted in canonical order (sources ascending by entity index,
|
|
211
|
+
* each source's targets ascending by id) so the bytes are independent of
|
|
212
|
+
* add/remove history — the same byte-level determinism invariant the sparse
|
|
213
|
+
* snapshot holds (#470). Layout (integers little-endian):
|
|
214
|
+
*
|
|
215
|
+
* u32 relationCount
|
|
216
|
+
* repeat relationCount times (registration / id order):
|
|
217
|
+
* u32 isMulti
|
|
218
|
+
* if multi:
|
|
219
|
+
* u32 sourceCount
|
|
220
|
+
* repeat sourceCount times (ascending source index):
|
|
221
|
+
* u32 sourceIndex
|
|
222
|
+
* u32 targetCount
|
|
223
|
+
* f64 × targetCount (target EntityIDs, ascending) */
|
|
224
|
+
export declare function snapshotRelations(relations: readonly RelationStore[]): Uint8Array;
|
|
225
|
+
/** Rebuild every relation's side indices from a `snapshotRelations` buffer and
|
|
226
|
+
* the already-restored sparse stores. Each relation's indices are reset first
|
|
227
|
+
* (idempotent into a dirty world), then:
|
|
228
|
+
*
|
|
229
|
+
* - **multi** — forward target sets and their reverse edges are rebuilt from
|
|
230
|
+
* `bytes` (the sets aren't in the sparse store, so the bytes are the only
|
|
231
|
+
* source). `makeId` maps a source entity index to its full `EntityID`
|
|
232
|
+
* (generation from the live slot) so reverse edges key correctly.
|
|
233
|
+
* - **exclusive** — only the reset happens here; the reverse index is rebuilt
|
|
234
|
+
* by the caller from the backing sparse store (which already round-tripped
|
|
235
|
+
* through `restoreSparseStores`), since this function can't read it.
|
|
236
|
+
*
|
|
237
|
+
* Throws `SparseRestoreError` on any shape mismatch (relation count, an
|
|
238
|
+
* exclusive/multi flag that disagrees with the registered relation, a multi
|
|
239
|
+
* source index past `MAX_INDEX`, or a truncated / over-long buffer) rather than
|
|
240
|
+
* silently building a corrupt index. */
|
|
241
|
+
export declare function restoreRelations(relations: readonly RelationStore[], bytes: Uint8Array, makeId: (index: number) => EntityID): void;
|
|
242
|
+
export {};
|
|
243
|
+
//# sourceMappingURL=relation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relation.d.ts","sourceRoot":"","sources":["../../../src/core/ecs/relation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4DK;AAEL,OAAO,EAAE,KAAK,EAAc,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,KAAK,QAAQ,EAA4C,MAAM,UAAU,CAAC;AACnF,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAEzB,MAAM,gBAAgB,CAAC;AAExB;;0EAE0E;AAC1E,MAAM,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAItD,OAAO,CAAC,MAAM,eAAe,EAAE,OAAO,MAAM,CAAC;AAE7C;kEACkE;AAClE,MAAM,MAAM,mBAAmB,GAAG,WAAW,GAAG,OAAO,CAAC;AAYxD,OAAO,CAAC,MAAM,qBAAqB,EAAE,OAAO,MAAM,CAAC;AAEnD,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,mBAAmB,GAAG,mBAAmB,IAAI,UAAU,GAAG;IAC3F,QAAQ,CAAC,CAAC,eAAe,CAAC,EAAE,UAAU,CAAC;IACvC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;CACvC,CAAC;AAEF;;;;;;;gFAOg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