@oasys/oecs 0.5.3 → 0.6.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 +1399 -276
- package/README.md +327 -169
- package/dist/core/ecs/access_check.d.cts +31 -31
- package/dist/core/ecs/access_check.d.ts +31 -31
- package/dist/core/ecs/access_check.d.ts.map +1 -1
- package/dist/core/ecs/archetype.d.cts +273 -205
- package/dist/core/ecs/archetype.d.ts +273 -205
- package/dist/core/ecs/archetype.d.ts.map +1 -1
- package/dist/core/ecs/archetype_closure.d.cts +23 -0
- package/dist/core/ecs/archetype_closure.d.ts +23 -0
- package/dist/core/ecs/archetype_closure.d.ts.map +1 -0
- package/dist/core/ecs/archetype_graph.d.cts +34 -34
- package/dist/core/ecs/archetype_graph.d.ts +34 -34
- package/dist/core/ecs/archetype_graph.d.ts.map +1 -1
- package/dist/core/ecs/archetype_types.d.cts +55 -0
- package/dist/core/ecs/archetype_types.d.ts +55 -0
- package/dist/core/ecs/archetype_types.d.ts.map +1 -0
- package/dist/core/ecs/change_feed.d.cts +53 -0
- package/dist/core/ecs/change_feed.d.ts +53 -0
- package/dist/core/ecs/change_feed.d.ts.map +1 -0
- package/dist/core/ecs/changed_query.d.cts +36 -0
- package/dist/core/ecs/changed_query.d.ts +36 -0
- package/dist/core/ecs/changed_query.d.ts.map +1 -0
- package/dist/core/ecs/chunk_columns.d.cts +49 -0
- package/dist/core/ecs/chunk_columns.d.ts +49 -0
- package/dist/core/ecs/chunk_columns.d.ts.map +1 -0
- package/dist/core/ecs/command_log.d.cts +30 -30
- package/dist/core/ecs/command_log.d.ts +30 -30
- package/dist/core/ecs/command_log.d.ts.map +1 -1
- package/dist/core/ecs/component.d.cts +45 -44
- package/dist/core/ecs/component.d.ts +45 -44
- package/dist/core/ecs/component.d.ts.map +1 -1
- package/dist/core/ecs/component_registry.d.cts +53 -0
- package/dist/core/ecs/component_registry.d.ts +53 -0
- package/dist/core/ecs/component_registry.d.ts.map +1 -0
- package/dist/core/ecs/compute_backend.d.cts +18 -7
- package/dist/core/ecs/compute_backend.d.ts +18 -7
- package/dist/core/ecs/compute_backend.d.ts.map +1 -1
- package/dist/core/ecs/deferred_commands.d.cts +15 -14
- package/dist/core/ecs/deferred_commands.d.ts +15 -14
- package/dist/core/ecs/deferred_commands.d.ts.map +1 -1
- package/dist/core/ecs/dispatch_trace.d.cts +32 -31
- package/dist/core/ecs/dispatch_trace.d.ts +32 -31
- package/dist/core/ecs/dispatch_trace.d.ts.map +1 -1
- package/dist/core/ecs/ecs.d.cts +337 -276
- package/dist/core/ecs/ecs.d.ts +337 -276
- package/dist/core/ecs/ecs.d.ts.map +1 -1
- package/dist/core/ecs/ecs_memory.d.cts +134 -136
- package/dist/core/ecs/ecs_memory.d.ts +134 -136
- package/dist/core/ecs/ecs_memory.d.ts.map +1 -1
- package/dist/core/ecs/ecs_options.d.cts +89 -0
- package/dist/core/ecs/ecs_options.d.ts +89 -0
- package/dist/core/ecs/ecs_options.d.ts.map +1 -0
- package/dist/core/ecs/entity.d.cts +4 -4
- package/dist/core/ecs/entity.d.ts +4 -4
- package/dist/core/ecs/entity_allocator.d.cts +24 -22
- package/dist/core/ecs/entity_allocator.d.ts +24 -22
- package/dist/core/ecs/entity_allocator.d.ts.map +1 -1
- package/dist/core/ecs/event.d.cts +37 -23
- package/dist/core/ecs/event.d.ts +37 -23
- package/dist/core/ecs/event.d.ts.map +1 -1
- package/dist/core/ecs/facades.d.cts +12 -126
- package/dist/core/ecs/facades.d.ts +12 -126
- package/dist/core/ecs/facades.d.ts.map +1 -1
- package/dist/core/ecs/frame_stepper.d.cts +12 -12
- package/dist/core/ecs/frame_stepper.d.ts +12 -12
- package/dist/core/ecs/frame_stepper.d.ts.map +1 -1
- package/dist/core/ecs/frame_trace.d.cts +34 -34
- package/dist/core/ecs/frame_trace.d.ts +34 -34
- package/dist/core/ecs/frame_trace.d.ts.map +1 -1
- package/dist/core/ecs/host_commands.d.cts +107 -89
- package/dist/core/ecs/host_commands.d.ts +107 -89
- package/dist/core/ecs/host_commands.d.ts.map +1 -1
- package/dist/core/ecs/index.d.cts +22 -12
- package/dist/core/ecs/index.d.ts +22 -12
- package/dist/core/ecs/index.d.ts.map +1 -1
- package/dist/core/ecs/observer.d.cts +41 -122
- package/dist/core/ecs/observer.d.ts +41 -122
- package/dist/core/ecs/observer.d.ts.map +1 -1
- package/dist/core/ecs/phase.d.cts +79 -0
- package/dist/core/ecs/phase.d.ts +79 -0
- package/dist/core/ecs/phase.d.ts.map +1 -0
- package/dist/core/ecs/plugin.d.cts +125 -0
- package/dist/core/ecs/plugin.d.ts +125 -0
- package/dist/core/ecs/plugin.d.ts.map +1 -0
- package/dist/core/ecs/plugin_slots.d.cts +26 -0
- package/dist/core/ecs/plugin_slots.d.ts +26 -0
- package/dist/core/ecs/plugin_slots.d.ts.map +1 -0
- package/dist/core/ecs/query.d.cts +219 -568
- package/dist/core/ecs/query.d.ts +219 -568
- package/dist/core/ecs/query.d.ts.map +1 -1
- package/dist/core/ecs/query_cache.d.cts +130 -0
- package/dist/core/ecs/query_cache.d.ts +130 -0
- package/dist/core/ecs/query_cache.d.ts.map +1 -0
- package/dist/core/ecs/query_registry.d.cts +47 -0
- package/dist/core/ecs/query_registry.d.ts +47 -0
- package/dist/core/ecs/query_registry.d.ts.map +1 -0
- package/dist/core/ecs/query_terms.d.cts +126 -0
- package/dist/core/ecs/query_terms.d.ts +126 -0
- package/dist/core/ecs/query_terms.d.ts.map +1 -0
- package/dist/core/ecs/ref.d.cts +129 -16
- package/dist/core/ecs/ref.d.ts +129 -16
- package/dist/core/ecs/ref.d.ts.map +1 -1
- package/dist/core/ecs/relation.d.cts +105 -186
- package/dist/core/ecs/relation.d.ts +105 -186
- package/dist/core/ecs/relation.d.ts.map +1 -1
- package/dist/core/ecs/resource.d.cts +14 -14
- package/dist/core/ecs/resource.d.ts +14 -14
- package/dist/core/ecs/resource_registry.d.cts +6 -6
- package/dist/core/ecs/resource_registry.d.ts +6 -6
- package/dist/core/ecs/resource_registry.d.ts.map +1 -1
- package/dist/core/ecs/row_kinds.d.cts +24 -0
- package/dist/core/ecs/row_kinds.d.ts +24 -0
- package/dist/core/ecs/row_kinds.d.ts.map +1 -0
- package/dist/core/ecs/run_condition.d.cts +23 -23
- package/dist/core/ecs/run_condition.d.ts +23 -23
- package/dist/core/ecs/run_condition.d.ts.map +1 -1
- package/dist/core/ecs/schedule.d.cts +98 -114
- package/dist/core/ecs/schedule.d.ts +98 -114
- package/dist/core/ecs/schedule.d.ts.map +1 -1
- package/dist/core/ecs/schedule_plan.d.cts +33 -0
- package/dist/core/ecs/schedule_plan.d.ts +33 -0
- package/dist/core/ecs/schedule_plan.d.ts.map +1 -0
- package/dist/core/ecs/snapshot.d.cts +77 -0
- package/dist/core/ecs/snapshot.d.ts +77 -0
- package/dist/core/ecs/snapshot.d.ts.map +1 -0
- package/dist/core/ecs/snapshot_mount.d.cts +42 -0
- package/dist/core/ecs/snapshot_mount.d.ts +42 -0
- package/dist/core/ecs/snapshot_mount.d.ts.map +1 -0
- package/dist/core/ecs/sparse_store.d.cts +110 -53
- package/dist/core/ecs/sparse_store.d.ts +110 -53
- package/dist/core/ecs/sparse_store.d.ts.map +1 -1
- package/dist/core/ecs/store.d.cts +644 -511
- package/dist/core/ecs/store.d.ts +644 -511
- package/dist/core/ecs/store.d.ts.map +1 -1
- package/dist/core/ecs/store_layout_listener.d.cts +8 -8
- package/dist/core/ecs/store_layout_listener.d.ts +8 -8
- package/dist/core/ecs/store_types.d.cts +122 -0
- package/dist/core/ecs/store_types.d.ts +122 -0
- package/dist/core/ecs/store_types.d.ts.map +1 -0
- package/dist/core/ecs/system.d.cts +151 -66
- package/dist/core/ecs/system.d.ts +151 -66
- package/dist/core/ecs/system.d.ts.map +1 -1
- package/dist/core/ecs/system_context.d.cts +296 -0
- package/dist/core/ecs/system_context.d.ts +296 -0
- package/dist/core/ecs/system_context.d.ts.map +1 -0
- package/dist/core/ecs/system_set.d.cts +48 -0
- package/dist/core/ecs/system_set.d.ts +48 -0
- package/dist/core/ecs/system_set.d.ts.map +1 -0
- package/dist/core/ecs/utils/arrays.d.cts +15 -1
- package/dist/core/ecs/utils/arrays.d.ts +15 -1
- package/dist/core/ecs/utils/arrays.d.ts.map +1 -1
- package/dist/core/ecs/utils/error.d.cts +87 -4
- package/dist/core/ecs/utils/error.d.ts +87 -4
- package/dist/core/ecs/utils/error.d.ts.map +1 -1
- package/dist/core/ecs/utils/plugin_error.d.cts +10 -0
- package/dist/core/ecs/utils/plugin_error.d.ts +10 -0
- package/dist/core/ecs/utils/plugin_error.d.ts.map +1 -0
- package/dist/core/restore_errors.d.cts +30 -0
- package/dist/core/restore_errors.d.ts +30 -0
- package/dist/core/restore_errors.d.ts.map +1 -0
- package/dist/core/store/action_ring.d.cts +48 -49
- package/dist/core/store/action_ring.d.ts +48 -49
- package/dist/core/store/action_ring.d.ts.map +1 -1
- package/dist/core/store/allocator.d.cts +166 -114
- package/dist/core/store/allocator.d.ts +166 -114
- package/dist/core/store/allocator.d.ts.map +1 -1
- package/dist/core/store/buffer_backed_column.d.cts +21 -22
- package/dist/core/store/buffer_backed_column.d.ts +21 -22
- package/dist/core/store/buffer_backed_column.d.ts.map +1 -1
- package/dist/core/store/column_store.d.cts +138 -100
- package/dist/core/store/column_store.d.ts +138 -100
- package/dist/core/store/column_store.d.ts.map +1 -1
- package/dist/core/store/command_dispatch.d.cts +14 -15
- package/dist/core/store/command_dispatch.d.ts +14 -15
- package/dist/core/store/command_dispatch.d.ts.map +1 -1
- package/dist/core/store/command_ring.d.cts +41 -45
- package/dist/core/store/command_ring.d.ts +41 -45
- package/dist/core/store/command_ring.d.ts.map +1 -1
- package/dist/core/store/descriptor.d.cts +35 -18
- package/dist/core/store/descriptor.d.ts +35 -18
- package/dist/core/store/descriptor.d.ts.map +1 -1
- package/dist/core/store/entity_index.d.cts +34 -35
- package/dist/core/store/entity_index.d.ts +34 -35
- package/dist/core/store/entity_index.d.ts.map +1 -1
- package/dist/core/store/event_ring.d.cts +40 -42
- package/dist/core/store/event_ring.d.ts +40 -42
- package/dist/core/store/event_ring.d.ts.map +1 -1
- package/dist/core/store/extend.d.cts +15 -9
- package/dist/core/store/extend.d.ts +15 -9
- package/dist/core/store/extend.d.ts.map +1 -1
- package/dist/core/store/grow.d.cts +3 -3
- package/dist/core/store/grow.d.ts +3 -3
- package/dist/core/store/grow.d.ts.map +1 -1
- package/dist/core/store/header.d.cts +37 -33
- package/dist/core/store/header.d.ts +37 -33
- package/dist/core/store/header.d.ts.map +1 -1
- package/dist/core/store/index.d.cts +10 -10
- package/dist/core/store/index.d.ts +10 -10
- package/dist/core/store/index.d.ts.map +1 -1
- package/dist/core/store/layout_ops.d.cts +72 -63
- package/dist/core/store/layout_ops.d.ts +72 -63
- package/dist/core/store/layout_ops.d.ts.map +1 -1
- package/dist/core/store/region_table.d.cts +28 -21
- package/dist/core/store/region_table.d.ts +28 -21
- package/dist/core/store/region_table.d.ts.map +1 -1
- package/dist/core/store/snapshot.d.cts +31 -16
- package/dist/core/store/snapshot.d.ts +31 -16
- package/dist/core/store/snapshot.d.ts.map +1 -1
- package/dist/core/store/state_hash.d.cts +14 -14
- package/dist/core/store/state_hash.d.ts +14 -14
- package/dist/core/store/state_hash.d.ts.map +1 -1
- package/dist/core/store/store_regions.d.cts +10 -10
- package/dist/core/store/store_regions.d.ts +10 -10
- package/dist/core/store/store_regions.d.ts.map +1 -1
- package/dist/core/store/vendored_abi/abi.d.cts +27 -2
- package/dist/core/store/vendored_abi/abi.d.ts +27 -2
- package/dist/core/store/vendored_abi/abi.d.ts.map +1 -1
- package/dist/host_commands-B2KMx8O2.cjs +1 -0
- package/dist/host_commands-ClVPvhSa.cjs +2 -0
- package/dist/host_commands-CwxVQS1z.js +1524 -0
- package/dist/host_commands-nJvTy88E.js +1667 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +16 -11
- package/dist/index.d.ts +16 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.development.cjs +1 -1
- package/dist/index.development.js +6709 -5729
- package/dist/index.js +5664 -4743
- package/dist/internal.cjs +2 -2
- package/dist/internal.d.cts +5 -2
- package/dist/internal.d.ts +5 -2
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.development.cjs +1 -1
- package/dist/internal.development.js +70 -20
- package/dist/internal.js +138 -83
- package/dist/plugins/abi-D3V-QUSf.cjs +1 -0
- package/dist/plugins/abi-NP8pNxpd.js +42 -0
- package/dist/plugins/arrays-Dr_1hCjL.js +28 -0
- package/dist/plugins/arrays-Dt-Joc4i.cjs +1 -0
- package/dist/plugins/assertions-gtDVfbnQ.js +6 -0
- package/dist/plugins/assertions-z5GQd_bB.cjs +1 -0
- package/dist/{extensions → plugins}/editor/editor.d.cts +56 -56
- package/dist/{extensions → plugins}/editor/editor.d.ts +56 -56
- package/dist/plugins/editor/editor.d.ts.map +1 -0
- package/dist/{extensions → plugins}/editor/field_handle.d.cts +13 -13
- package/dist/{extensions → plugins}/editor/field_handle.d.ts +13 -13
- package/dist/plugins/editor/field_handle.d.ts.map +1 -0
- package/dist/plugins/editor/index.d.cts +22 -0
- package/dist/plugins/editor/index.d.ts +22 -0
- package/dist/plugins/editor/index.d.ts.map +1 -0
- package/dist/plugins/editor.cjs +1 -0
- package/dist/plugins/editor.d.cts +1 -0
- package/dist/plugins/editor.d.ts +1 -0
- package/dist/plugins/editor.development.cjs +1 -0
- package/dist/{extensions/editor/index.development.js → plugins/editor.development.js} +83 -66
- package/dist/{extensions/editor/index.js → plugins/editor.js} +83 -66
- package/dist/plugins/events/event_channel.d.cts +13 -0
- package/dist/plugins/events/event_channel.d.ts +13 -0
- package/dist/plugins/events/event_channel.d.ts.map +1 -0
- package/dist/plugins/events/event_registry.d.cts +22 -0
- package/dist/plugins/events/event_registry.d.ts +22 -0
- package/dist/plugins/events/event_registry.d.ts.map +1 -0
- package/dist/plugins/events/facade.d.cts +26 -0
- package/dist/plugins/events/facade.d.ts +26 -0
- package/dist/plugins/events/facade.d.ts.map +1 -0
- package/dist/plugins/events/index.d.cts +10 -0
- package/dist/plugins/events/index.d.ts +10 -0
- package/dist/plugins/events/index.d.ts.map +1 -0
- package/dist/plugins/events.cjs +1 -0
- package/dist/plugins/events.d.cts +1 -0
- package/dist/plugins/events.d.ts +1 -0
- package/dist/plugins/events.development.cjs +1 -0
- package/dist/plugins/events.development.js +174 -0
- package/dist/plugins/events.js +159 -0
- package/dist/plugins/observers/index.d.cts +23 -0
- package/dist/plugins/observers/index.d.ts +23 -0
- package/dist/plugins/observers/index.d.ts.map +1 -0
- package/dist/plugins/observers/observer_registry.d.cts +101 -0
- package/dist/plugins/observers/observer_registry.d.ts +101 -0
- package/dist/plugins/observers/observer_registry.d.ts.map +1 -0
- package/dist/plugins/observers.cjs +1 -0
- package/dist/plugins/observers.d.cts +1 -0
- package/dist/plugins/observers.d.ts +1 -0
- package/dist/plugins/observers.development.cjs +1 -0
- package/dist/plugins/observers.development.js +431 -0
- package/dist/plugins/observers.js +403 -0
- package/dist/plugins/relation_store-BsoegrZh.js +313 -0
- package/dist/plugins/relation_store-DQKSnxsm.cjs +1 -0
- package/dist/plugins/relation_store-RBhpcE28.cjs +1 -0
- package/dist/plugins/relation_store-RqW5Snx6.js +328 -0
- package/dist/plugins/relations/builtin_relations.d.cts +48 -0
- package/dist/plugins/relations/builtin_relations.d.ts +48 -0
- package/dist/plugins/relations/builtin_relations.d.ts.map +1 -0
- package/dist/plugins/relations/facade.d.cts +73 -0
- package/dist/plugins/relations/facade.d.ts +73 -0
- package/dist/plugins/relations/facade.d.ts.map +1 -0
- package/dist/plugins/relations/index.d.cts +11 -0
- package/dist/plugins/relations/index.d.ts +11 -0
- package/dist/plugins/relations/index.d.ts.map +1 -0
- package/dist/{core/ecs → plugins/relations}/relation_service.d.cts +93 -105
- package/dist/{core/ecs → plugins/relations}/relation_service.d.ts +93 -105
- package/dist/plugins/relations/relation_service.d.ts.map +1 -0
- package/dist/plugins/relations/relation_store.d.cts +177 -0
- package/dist/plugins/relations/relation_store.d.ts +177 -0
- package/dist/plugins/relations/relation_store.d.ts.map +1 -0
- package/dist/plugins/relations.cjs +1 -0
- package/dist/plugins/relations.d.cts +1 -0
- package/dist/plugins/relations.d.ts +1 -0
- package/dist/plugins/relations.development.cjs +1 -0
- package/dist/plugins/relations.development.js +603 -0
- package/dist/plugins/relations.js +553 -0
- package/dist/plugins/snapshots/index.d.cts +33 -0
- package/dist/plugins/snapshots/index.d.ts +33 -0
- package/dist/plugins/snapshots/index.d.ts.map +1 -0
- package/dist/plugins/snapshots/resume.d.cts +57 -0
- package/dist/plugins/snapshots/resume.d.ts +57 -0
- package/dist/plugins/snapshots/resume.d.ts.map +1 -0
- package/dist/plugins/snapshots/snapshot_service.d.cts +59 -0
- package/dist/plugins/snapshots/snapshot_service.d.ts +59 -0
- package/dist/plugins/snapshots/snapshot_service.d.ts.map +1 -0
- package/dist/plugins/snapshots.cjs +1 -0
- package/dist/plugins/snapshots.d.cts +1 -0
- package/dist/plugins/snapshots.d.ts +1 -0
- package/dist/plugins/snapshots.development.cjs +1 -0
- package/dist/plugins/snapshots.development.js +737 -0
- package/dist/plugins/snapshots.js +737 -0
- package/dist/plugins/solid/index.d.cts +8 -0
- package/dist/plugins/solid/index.d.ts +8 -0
- package/dist/plugins/solid/index.d.ts.map +1 -0
- package/dist/plugins/solid/solid.d.cts +97 -0
- package/dist/plugins/solid/solid.d.ts +97 -0
- package/dist/plugins/solid/solid.d.ts.map +1 -0
- package/dist/plugins/solid.cjs +1 -0
- package/dist/plugins/solid.d.cts +1 -0
- package/dist/plugins/solid.d.ts +1 -0
- package/dist/plugins/solid.development.cjs +1 -0
- package/dist/plugins/solid.development.js +319 -0
- package/dist/plugins/solid.js +319 -0
- package/dist/plugins/workers/index.d.cts +75 -0
- package/dist/plugins/workers/index.d.ts +75 -0
- package/dist/plugins/workers/index.d.ts.map +1 -0
- package/dist/plugins/workers/node_threads.d.cts +25 -0
- package/dist/plugins/workers/node_threads.d.ts +25 -0
- package/dist/plugins/workers/node_threads.d.ts.map +1 -0
- package/dist/plugins/workers/plan.d.cts +61 -0
- package/dist/plugins/workers/plan.d.ts +61 -0
- package/dist/plugins/workers/plan.d.ts.map +1 -0
- package/dist/plugins/workers/pool.d.cts +144 -0
- package/dist/plugins/workers/pool.d.ts +144 -0
- package/dist/plugins/workers/pool.d.ts.map +1 -0
- package/dist/plugins/workers/protocol.d.cts +112 -0
- package/dist/plugins/workers/protocol.d.ts +112 -0
- package/dist/plugins/workers/protocol.d.ts.map +1 -0
- package/dist/plugins/workers/worker_bind.d.cts +64 -0
- package/dist/plugins/workers/worker_bind.d.ts +64 -0
- package/dist/plugins/workers/worker_bind.d.ts.map +1 -0
- package/dist/plugins/workers/worker_loop.d.cts +14 -0
- package/dist/plugins/workers/worker_loop.d.ts +14 -0
- package/dist/plugins/workers/worker_loop.d.ts.map +1 -0
- package/dist/plugins/workers.cjs +1 -0
- package/dist/plugins/workers.d.cts +1 -0
- package/dist/plugins/workers.d.ts +1 -0
- package/dist/plugins/workers.development.cjs +1 -0
- package/dist/plugins/workers.development.js +596 -0
- package/dist/plugins/workers.js +474 -0
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.d.cts +4 -4
- package/dist/primitives.d.ts +4 -4
- package/dist/primitives.development.cjs +1 -1
- package/dist/primitives.development.js +66 -22
- package/dist/primitives.js +66 -22
- package/dist/shared-BKl12xF1.js +132 -0
- package/dist/shared-Dk-pACZT.cjs +1 -0
- package/dist/shared.cjs +1 -1
- package/dist/shared.d.cts +7 -7
- package/dist/shared.d.ts +7 -7
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.development.cjs +1 -1
- package/dist/shared.development.js +4 -3
- package/dist/shared.js +4 -3
- package/dist/topological_sort-Cc_yXqPT.js +346 -0
- package/dist/topological_sort-vp1imU6D.cjs +1 -0
- package/dist/type_primitives/assertions.d.cts +12 -16
- package/dist/type_primitives/assertions.d.ts +12 -16
- package/dist/type_primitives/assertions.d.ts.map +1 -1
- package/dist/type_primitives/binary_heap/binary_heap.d.cts +2 -6
- package/dist/type_primitives/binary_heap/binary_heap.d.ts +2 -6
- package/dist/type_primitives/binary_heap/binary_heap.d.ts.map +1 -1
- package/dist/type_primitives/bitset/bitset.d.cts +7 -11
- package/dist/type_primitives/bitset/bitset.d.ts +7 -11
- package/dist/type_primitives/bitset/bitset.d.ts.map +1 -1
- package/dist/type_primitives/brand.d.cts +2 -7
- package/dist/type_primitives/brand.d.ts +2 -7
- package/dist/type_primitives/brand.d.ts.map +1 -1
- package/dist/type_primitives/error.d.cts +1 -2
- package/dist/type_primitives/error.d.ts +1 -2
- package/dist/type_primitives/error.d.ts.map +1 -1
- package/dist/type_primitives/index.d.cts +1 -1
- package/dist/type_primitives/index.d.ts +1 -1
- package/dist/type_primitives/sparse_map/sparse_map.d.cts +3 -7
- package/dist/type_primitives/sparse_map/sparse_map.d.ts +3 -7
- package/dist/type_primitives/sparse_map/sparse_map.d.ts.map +1 -1
- package/dist/type_primitives/sparse_set/sparse_set.d.cts +2 -6
- package/dist/type_primitives/sparse_set/sparse_set.d.ts +2 -6
- package/dist/type_primitives/sparse_set/sparse_set.d.ts.map +1 -1
- package/dist/type_primitives/topological_sort/topological_sort.d.cts +1 -5
- package/dist/type_primitives/topological_sort/topological_sort.d.ts +1 -5
- package/dist/type_primitives/topological_sort/topological_sort.d.ts.map +1 -1
- package/dist/type_primitives/typed_arrays/typed_arrays.d.cts +18 -17
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts +18 -17
- package/dist/type_primitives/typed_arrays/typed_arrays.d.ts.map +1 -1
- package/dist/utils/error.d.ts.map +1 -1
- package/dist/version.d.cts +4 -4
- package/dist/version.d.ts +4 -4
- package/dist/worker.cjs +1 -0
- package/dist/worker.d.cts +17 -0
- package/dist/worker.d.ts +17 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.development.cjs +1 -0
- package/dist/worker.development.js +253 -0
- package/dist/worker.js +253 -0
- package/package.json +363 -191
- package/dist/core/ecs/builtin_relations.d.cts +0 -43
- package/dist/core/ecs/builtin_relations.d.ts +0 -43
- package/dist/core/ecs/builtin_relations.d.ts.map +0 -1
- package/dist/core/ecs/event_registry.d.cts +0 -22
- package/dist/core/ecs/event_registry.d.ts +0 -22
- package/dist/core/ecs/event_registry.d.ts.map +0 -1
- package/dist/core/ecs/relation_service.d.ts.map +0 -1
- package/dist/core/ecs/resume.d.cts +0 -85
- package/dist/core/ecs/resume.d.ts +0 -85
- package/dist/core/ecs/resume.d.ts.map +0 -1
- package/dist/core/ecs/snapshot_service.d.cts +0 -94
- package/dist/core/ecs/snapshot_service.d.ts +0 -94
- package/dist/core/ecs/snapshot_service.d.ts.map +0 -1
- package/dist/extensions/editor/editor.d.ts.map +0 -1
- package/dist/extensions/editor/field_handle.d.ts.map +0 -1
- package/dist/extensions/editor/index.cjs +0 -1
- package/dist/extensions/editor/index.d.cts +0 -21
- package/dist/extensions/editor/index.d.ts +0 -21
- package/dist/extensions/editor/index.d.ts.map +0 -1
- package/dist/extensions/editor/index.development.cjs +0 -1
- package/dist/extensions/reactive/ecs_sync.d.cts +0 -214
- package/dist/extensions/reactive/ecs_sync.d.ts +0 -214
- package/dist/extensions/reactive/ecs_sync.d.ts.map +0 -1
- package/dist/extensions/reactive/index.cjs +0 -1
- package/dist/extensions/reactive/index.d.cts +0 -23
- package/dist/extensions/reactive/index.d.ts +0 -23
- package/dist/extensions/reactive/index.d.ts.map +0 -1
- package/dist/extensions/reactive/index.development.cjs +0 -1
- package/dist/extensions/reactive/index.development.js +0 -215
- package/dist/extensions/reactive/index.js +0 -215
- package/dist/extensions/solid/index.cjs +0 -1
- package/dist/extensions/solid/index.d.cts +0 -6
- package/dist/extensions/solid/index.d.ts +0 -6
- package/dist/extensions/solid/index.d.ts.map +0 -1
- package/dist/extensions/solid/index.development.cjs +0 -1
- package/dist/extensions/solid/index.development.js +0 -40
- package/dist/extensions/solid/index.js +0 -36
- package/dist/extensions/solid/kernel_solid.d.cts +0 -45
- package/dist/extensions/solid/kernel_solid.d.ts +0 -45
- package/dist/extensions/solid/kernel_solid.d.ts.map +0 -1
- package/dist/host_commands-3jyFfWNg.js +0 -2326
- package/dist/host_commands-DNf0f6ko.cjs +0 -1
- package/dist/internal-C9jjL90H.js +0 -2485
- package/dist/internal-RZN14uMw.cjs +0 -2
- package/dist/interop-CT-REx0W.cjs +0 -1
- package/dist/interop-CcY6ASQc.js +0 -18
- package/dist/interop-DqxleBo7.js +0 -18
- package/dist/interop-T1HZ-Dpa.cjs +0 -1
- package/dist/kernel-Cz2Kxlwl.js +0 -240
- package/dist/kernel-DgyrLFjW.js +0 -227
- package/dist/kernel-sw7ScKWu.cjs +0 -1
- package/dist/kernel-yWV3XnAb.cjs +0 -1
- package/dist/reactive/array.d.cts +0 -24
- package/dist/reactive/array.d.ts +0 -24
- package/dist/reactive/array.d.ts.map +0 -1
- package/dist/reactive/index.cjs +0 -1
- package/dist/reactive/index.d.cts +0 -11
- package/dist/reactive/index.d.ts +0 -11
- package/dist/reactive/index.d.ts.map +0 -1
- package/dist/reactive/index.development.cjs +0 -1
- package/dist/reactive/index.development.js +0 -18
- package/dist/reactive/index.js +0 -18
- package/dist/reactive/interop.d.cts +0 -19
- package/dist/reactive/interop.d.ts +0 -19
- package/dist/reactive/interop.d.ts.map +0 -1
- package/dist/reactive/kernel.d.cts +0 -73
- package/dist/reactive/kernel.d.ts +0 -73
- package/dist/reactive/kernel.d.ts.map +0 -1
- package/dist/reactive/map.d.cts +0 -16
- package/dist/reactive/map.d.ts +0 -16
- package/dist/reactive/map.d.ts.map +0 -1
- package/dist/reactive/shallow.d.cts +0 -11
- package/dist/reactive/shallow.d.ts +0 -11
- package/dist/reactive/shallow.d.ts.map +0 -1
- package/dist/reactive/struct.d.cts +0 -10
- package/dist/reactive/struct.d.ts +0 -10
- package/dist/reactive/struct.d.ts.map +0 -1
- package/dist/shallow-9S1pY_Iw.js +0 -159
- package/dist/shallow-C5YmTbtb.cjs +0 -1
- package/dist/shallow-DQ8aG51_.cjs +0 -1
- package/dist/shallow-DfnAm9vG.js +0 -150
- package/dist/shared-BMXh9hxm.cjs +0 -1
- package/dist/shared-DQKK0i-E.js +0 -109
- package/dist/topological_sort-BDvEyb9W.cjs +0 -1
- package/dist/topological_sort-DK6EjpWa.js +0 -135
- package/dist/typed_arrays-BcXcnzB4.js +0 -258
- package/dist/typed_arrays-D3NmwtCG.cjs +0 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { EntityID } from '../../core/ecs/entity.js';
|
|
2
|
+
import { SparseComponentDef, SparseComponentStore } from '../../core/ecs/sparse_store.js';
|
|
3
|
+
import { CanonicalPairFn, CanonicalTargetSetFn, MakeSourceID, OnDeleteTarget, RelationStoreView } from '../../core/ecs/relation.js';
|
|
4
|
+
/** One relation's derived side state. **Abstract over cardinality:** the
|
|
5
|
+
* base owns the cardinality-agnostic **reverse index** (target → sources, keyed
|
|
6
|
+
* by full `EntityID` so a recycled slot can't alias a dead target's sources) and
|
|
7
|
+
* a handle on the backing `SparseComponentStore`. The forward representation and
|
|
8
|
+
* its sparse interaction are owned by the concrete `ExclusiveRelationStore` and
|
|
9
|
+
* `MultiRelationStore` (built by `createRelationStore`).
|
|
10
|
+
*
|
|
11
|
+
* The registry level (`Store` and `RelationService`) owns what is genuinely its
|
|
12
|
+
* own, entity liveness, registration, and destroy orchestration, and drives
|
|
13
|
+
* a relation through the virtual `link`,
|
|
14
|
+
* `unlink`, `purgeSource`, `forEachCanonicalPair` and their peers, without ever
|
|
15
|
+
* branching on cardinality. Each cardinality keeps the forward link, the reverse
|
|
16
|
+
* index and the sparse membership in lockstep inside one method on one class, so the
|
|
17
|
+
* lockstep can't be broken by missing a scattered `if (rs.exclusive)` site. */
|
|
18
|
+
export declare abstract class RelationStore implements RelationStoreView {
|
|
19
|
+
/** `true` → one target per source, held in the sparse field. `false` →
|
|
20
|
+
* a set of targets per source. The cardinality discriminant survives as a
|
|
21
|
+
* field because the snapshot header and the traversal and `targetOf`
|
|
22
|
+
* mode guards carry it. The forward mechanics stay virtual, never branched
|
|
23
|
+
* on it. */
|
|
24
|
+
readonly exclusive: boolean;
|
|
25
|
+
/** Backing sparse component def: `{ target: f64 }` when exclusive, a tag when
|
|
26
|
+
* multi. Carries membership (and the target, when exclusive). */
|
|
27
|
+
readonly sparse: SparseComponentDef;
|
|
28
|
+
/** Cleanup policy applied to this relation's sources when a target is
|
|
29
|
+
* destroyed. `orphan` (the default) is a no-op, the link dangles
|
|
30
|
+
* safely. `Store` reads this at destroy-flush off `sourcesOf`. */
|
|
31
|
+
readonly onDeleteTarget: OnDeleteTarget;
|
|
32
|
+
/** The backing sparse store instance. Owned for registration and liveness by
|
|
33
|
+
* `Store`, but the relation drives the forward and membership rows on it directly.
|
|
34
|
+
* That is the cardinality interaction this class now encapsulates. */
|
|
35
|
+
protected readonly _store: SparseComponentStore;
|
|
36
|
+
/** target `EntityID` → set of source `EntityID`s. Keyed by the full id, not
|
|
37
|
+
* the index, so a recycled target slot can't alias a dead target's sources.
|
|
38
|
+
* An entry is dropped the moment its set empties (`_unlinkReverse`). */
|
|
39
|
+
private readonly _reverse;
|
|
40
|
+
constructor(exclusive: boolean, sparse: SparseComponentDef, store: SparseComponentStore, onDeleteTarget: OnDeleteTarget);
|
|
41
|
+
/** Record that `src` points at `tgt` in the reverse index. */
|
|
42
|
+
protected _linkReverse(tgt: EntityID, src: EntityID): void;
|
|
43
|
+
/** Drop the `src → tgt` edge from the reverse index, removing the target's
|
|
44
|
+
* entry entirely once its last source is gone (so a dead-target key doesn't
|
|
45
|
+
* linger with an empty set). */
|
|
46
|
+
protected _unlinkReverse(tgt: EntityID, src: EntityID): void;
|
|
47
|
+
/** Drop every reverse-index entry whose **target** is no longer alive,
|
|
48
|
+
* returning the count dropped. The `orphan` policy intentionally
|
|
49
|
+
* leaves a destroyed target's reverse entry intact (the link dangles
|
|
50
|
+
* safely), so a long-lived source that orphan-points at a stream of
|
|
51
|
+
* short-lived targets and never re-targets or dies accumulates dead-target keys
|
|
52
|
+
* without bound. This is the reclaim primitive behind `ecs.relations.compact`,
|
|
53
|
+
* a cold path the host calls at scene and snapshot boundaries. It is
|
|
54
|
+
* cardinality-free (reverse-index only), so it lives on the base unchanged.
|
|
55
|
+
*
|
|
56
|
+
* Pure index reclaim: the **forward** links (the exclusive sparse target
|
|
57
|
+
* field, the multi forward set) are left untouched, so `targetOf` and
|
|
58
|
+
* `targetsOf` still return the dangling dead handle exactly as `orphan`
|
|
59
|
+
* promises. The reverse index is derived, so dropping a dead-target entry
|
|
60
|
+
* changes nothing observable except `sourcesOf` on that dead handle (which
|
|
61
|
+
* goes from the dangling sources to `[]`, meaningless either way, the target
|
|
62
|
+
* is gone) and is faithfully rebuilt by snapshot and restore from the surviving
|
|
63
|
+
* forward links. Only the **target** role can leak here: a destroyed *source*
|
|
64
|
+
* is already unlinked from every reverse set by `purgeSource`, so a live
|
|
65
|
+
* target's set never holds a dead source. `isAlive` is supplied by `Store`,
|
|
66
|
+
* which owns entity liveness. Deleting during `Map` key iteration is
|
|
67
|
+
* well-defined, already-visited and not-yet-reached keys are unaffected. */
|
|
68
|
+
pruneDeadReverse(isAlive: (id: EntityID) => boolean): number;
|
|
69
|
+
/** Sources that point at `tgt`, ascending by id (deterministic, cold-path
|
|
70
|
+
* sort), empty when none. */
|
|
71
|
+
sourcesOf(tgt: EntityID): EntityID[];
|
|
72
|
+
/** Drop every derived side index, the reverse index and (for multi) the
|
|
73
|
+
* forward target sets. Restore path only (`restoreRelations`): the side
|
|
74
|
+
* indices are rebuilt from scratch, so they're cleared first to stay
|
|
75
|
+
* idempotent when restoring into a dirty world. The backing sparse store is
|
|
76
|
+
* cleared separately by `restoreSparseStores`. */
|
|
77
|
+
resetIndices(): void;
|
|
78
|
+
/** Clear this relation's forward representation. Multi clears the side map.
|
|
79
|
+
* Exclusive clears nothing, because its forward links live in the sparse
|
|
80
|
+
* store, which `restoreSparseStores` clears. */
|
|
81
|
+
protected abstract _resetForward(): void;
|
|
82
|
+
/** Add a `(R, tgt)` link from `src`, keeping the forward link, the membership
|
|
83
|
+
* row and the reverse index in lockstep. Exclusive: replaces any existing target
|
|
84
|
+
* (idempotent if `tgt` is already the target). Multi: adds to the set
|
|
85
|
+
* (idempotent on a duplicate), establishing the membership tag on the first
|
|
86
|
+
* target. `src` must be live, `Store` checks before delegating. */
|
|
87
|
+
abstract link(src: EntityID, tgt: EntityID): void;
|
|
88
|
+
/** Remove `(R, tgt)` from `src`, or, when `tgt` is omitted, every target of
|
|
89
|
+
* `src`, keeping the forward link, the membership row and the reverse index
|
|
90
|
+
* in lockstep. A
|
|
91
|
+
* no-op when the link isn't present. */
|
|
92
|
+
abstract unlink(src: EntityID, tgt?: EntityID): void;
|
|
93
|
+
/** Purge a destroyed **source**: drop its forward link(s) and unlink it from
|
|
94
|
+
* every target's reverse set, but leave the sparse **membership** row alone,
|
|
95
|
+
* `Store._purgeSparse` drops that (for every store) right after, so this
|
|
96
|
+
* runs first and must not double-remove. */
|
|
97
|
+
abstract purgeSource(src: EntityID): void;
|
|
98
|
+
/** The single target of source `index`, or `undefined`. Exclusive reads the
|
|
99
|
+
* sparse field. Multi has no single target and returns `undefined` (matching
|
|
100
|
+
* the production `targetOf`-on-multi read, which the `DEV` guard rejects). */
|
|
101
|
+
abstract singleTargetAt(index: number): EntityID | undefined;
|
|
102
|
+
/** All targets of source `index`, ascending by id, one or zero for
|
|
103
|
+
* exclusive, the full sorted set for multi. The symmetric counterpart to
|
|
104
|
+
* `sourcesOf`. */
|
|
105
|
+
abstract targetsAt(index: number): EntityID[];
|
|
106
|
+
/** Whether source `index` holds any target under this relation (sparse
|
|
107
|
+
* membership). */
|
|
108
|
+
abstract hasIndex(index: number): boolean;
|
|
109
|
+
/** Fold `cb` over this relation's **multi** forward target sets in canonical
|
|
110
|
+
* order (sources ascending by index, each source's targets ascending by id),
|
|
111
|
+
* skipping empty sets. The single source of truth for the canonical multi
|
|
112
|
+
* traversal shared by `stateHash`, `snapshotRelations`, and `pairsOf`.
|
|
113
|
+
* Exclusive relations contribute via the sparse store, so this
|
|
114
|
+
* is a no-op for them. */
|
|
115
|
+
abstract forEachCanonicalTargetSet(cb: CanonicalTargetSetFn): void;
|
|
116
|
+
/** Fold `cb` over every `(source, target)` pair of this relation in canonical
|
|
117
|
+
* order, the `(R, *)` wildcard drive order. `createId` maps a source
|
|
118
|
+
* index to its full `EntityID`. Exclusive rides the backing store's
|
|
119
|
+
* `canonicalIndices`. Multi rides `forEachCanonicalTargetSet`. */
|
|
120
|
+
abstract forEachCanonicalPair(createId: MakeSourceID, cb: CanonicalPairFn): void;
|
|
121
|
+
/** Rebuild the reverse index from the forward links after a restore.
|
|
122
|
+
* Exclusive reads it back from the newly restored sparse target field (the
|
|
123
|
+
* reverse index is never serialized). Multi already rebuilt its reverse edges
|
|
124
|
+
* in `restoreAddTarget`, so this is a no-op for it. `createId` maps a source
|
|
125
|
+
* index to its full `EntityID`. */
|
|
126
|
+
abstract rebuildReverse(createId: MakeSourceID): void;
|
|
127
|
+
/** Restore one decoded multi forward edge `(source index → tgt)` plus its
|
|
128
|
+
* reverse edge (the source's full `EntityID` is `src`). Multi only, the
|
|
129
|
+
* snapshot header guards exclusive relations out before this is reached, so
|
|
130
|
+
* the exclusive override throws defensively. */
|
|
131
|
+
abstract restoreAddTarget(index: number, tgt: EntityID, src: EntityID): void;
|
|
132
|
+
}
|
|
133
|
+
/** Build the right `RelationStore` for a cardinality. The only construction
|
|
134
|
+
* site is `Store.registerRelation`, which resolves the backing sparse store and
|
|
135
|
+
* hands it in so the relation can drive forward and membership rows directly. */
|
|
136
|
+
export declare function createRelationStore(exclusive: boolean, sparse: SparseComponentDef, store: SparseComponentStore, onDeleteTarget: OnDeleteTarget): RelationStore;
|
|
137
|
+
/** Serialize the relation side data that does **not** live in the sparse store,
|
|
138
|
+
* i.e. each **multi** relation's forward target sets (`Map<source index,
|
|
139
|
+
* Set<target>>`). Exclusive relations store their target in the backing sparse
|
|
140
|
+
* field, so they ride `snapshotSparseStores` and contribute only a header
|
|
141
|
+
* here. The reverse index is fully derivable (from the sparse store for
|
|
142
|
+
* exclusive, from these sets for multi), so it is never serialized. It is
|
|
143
|
+
* rebuilt by `restoreRelations` + the caller's exclusive-reverse pass.
|
|
144
|
+
*
|
|
145
|
+
* Members are emitted in canonical order (sources ascending by entity index,
|
|
146
|
+
* each source's targets ascending by id) so the bytes are independent of
|
|
147
|
+
* add and remove history, the same byte-level determinism invariant the sparse
|
|
148
|
+
* snapshot holds. Layout (integers little-endian):
|
|
149
|
+
*
|
|
150
|
+
* u32 relationCount
|
|
151
|
+
* repeat relationCount times (registration and id order):
|
|
152
|
+
* u32 isMulti
|
|
153
|
+
* if multi:
|
|
154
|
+
* u32 sourceCount
|
|
155
|
+
* repeat sourceCount times (ascending source index):
|
|
156
|
+
* u32 sourceIndex
|
|
157
|
+
* u32 targetCount
|
|
158
|
+
* f64 × targetCount (target EntityIDs, ascending) */
|
|
159
|
+
export declare function snapshotRelations(relations: readonly RelationStoreView[]): Uint8Array;
|
|
160
|
+
/** Rebuild every relation's side indices from a `snapshotRelations` buffer and
|
|
161
|
+
* the already-restored sparse stores. Each relation's indices are reset first
|
|
162
|
+
* (idempotent into a dirty world), then:
|
|
163
|
+
*
|
|
164
|
+
* - **multi**, forward target sets and their reverse edges are rebuilt from
|
|
165
|
+
* `bytes` (the sets aren't in the sparse store, so the bytes are the only
|
|
166
|
+
* source). `createId` maps a source entity index to its full `EntityID`
|
|
167
|
+
* (generation from the live slot) so reverse edges key correctly.
|
|
168
|
+
* - **exclusive**, only the reset happens here. The reverse index is rebuilt
|
|
169
|
+
* by the caller from the backing sparse store (which already round-tripped
|
|
170
|
+
* through `restoreSparseStores`), since this function can't read it.
|
|
171
|
+
*
|
|
172
|
+
* Throws `SparseRestoreError` on any shape mismatch (relation count, an
|
|
173
|
+
* exclusive or multi flag that disagrees with the registered relation, a multi
|
|
174
|
+
* source index past `MAX_INDEX`, or a truncated or over-long buffer) rather than
|
|
175
|
+
* silently building a corrupt index. */
|
|
176
|
+
export declare function restoreRelations(relations: readonly RelationStoreView[], bytes: Uint8Array, createId: (index: number) => EntityID): void;
|
|
177
|
+
//# sourceMappingURL=relation_store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relation_store.d.ts","sourceRoot":"","sources":["../../../src/plugins/relations/relation_store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqDK;AAGL,OAAO,EAAE,KAAK,QAAQ,EAA4C,MAAM,uBAAuB,CAAC;AAChG,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAEzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAEN,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,MAAM,yBAAyB,CAAC;AAOjC;;;;;;;;;;;;;+EAa+E;AAC/E,8BAAsB,aAAc,YAAW,iBAAiB;IAC/D;;;;gBAIY;IACZ,SAAgB,SAAS,EAAE,OAAO,CAAC;IACnC;qEACiE;IACjE,SAAgB,MAAM,EAAE,kBAAkB,CAAC;IAC3C;;sEAEkE;IAClE,SAAgB,cAAc,EAAE,cAAc,CAAC;IAC/C;;0EAEsE;IACtE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,oBAAoB,CAAC;IAChD;;4EAEwE;IACxE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAkC;gBAG1D,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,oBAAoB,EAC3B,cAAc,EAAE,cAAc;IAU/B,8DAA8D;IAC9D,SAAS,CAAC,YAAY,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI;IAS1D;;oCAEgC;IAChC,SAAS,CAAC,cAAc,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI;IAO5D;;;;;;;;;;;;;;;;;;;;gFAoB4E;IACrE,gBAAgB,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE,QAAQ,KAAK,OAAO,GAAG,MAAM;IAWnE;iCAC6B;IACtB,SAAS,CAAC,GAAG,EAAE,QAAQ,GAAG,QAAQ,EAAE;IAY3C;;;;sDAIkD;IAC3C,YAAY,IAAI,IAAI;IAO3B;;oDAEgD;IAChD,SAAS,CAAC,QAAQ,CAAC,aAAa,IAAI,IAAI;IAExC;;;;uEAImE;aACnD,IAAI,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI;IAExD;;;4CAGwC;aACxB,MAAM,CAAC,GAAG,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,QAAQ,GAAG,IAAI;IAE3D;;;gDAG4C;aAC5B,WAAW,CAAC,GAAG,EAAE,QAAQ,GAAG,IAAI;IAEhD;;kFAE8E;aAC9D,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS;IAEnE;;sBAEkB;aACF,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,EAAE;IAEpD;sBACkB;aACF,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAEhD;;;;;8BAK0B;aACV,yBAAyB,CAAC,EAAE,EAAE,oBAAoB,GAAG,IAAI;IAEzE;;;sEAGkE;aAClD,oBAAoB,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,EAAE,eAAe,GAAG,IAAI;IAEvF;;;;uCAImC;aACnB,cAAc,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI;IAE5D;;;oDAGgD;aAChC,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,QAAQ,GAAG,IAAI;CACnF;AAyMD;;iFAEiF;AACjF,wBAAgB,mBAAmB,CAClC,SAAS,EAAE,OAAO,EAClB,MAAM,EAAE,kBAAkB,EAC1B,KAAK,EAAE,oBAAoB,EAC3B,cAAc,EAAE,cAAc,GAC5B,aAAa,CAIf;AAYD;;;;;;;;;;;;;;;;;;;;;+DAqB+D;AAC/D,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,SAAS,iBAAiB,EAAE,GAAG,UAAU,CAqDrF;AAED;;;;;;;;;;;;;;;wCAewC;AACxC,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,SAAS,iBAAiB,EAAE,EACvC,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,QAAQ,GACnC,IAAI,CA8EN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("./relation_store-DQKSnxsm.cjs"),w=require("./arrays-Dt-Joc4i.cjs"),I=require("../index.cjs"),y=require("./assertions-z5GQd_bB.cjs");class D{constructor(t){this._host=t}_relations=[];_hasTargetCleanup=!1;_hierarchyRadixOut=new Uint32Array(1024);_hierarchyRadixC0=new Int32Array(1024);_hierarchyRadixC1=new Int32Array(1024);get stores(){return this._relations}get count(){return this._relations.length}get hasTargetCleanup(){return this._hasTargetCleanup}registerRelation(t){const e=t?.multi===!0,s=t?.exclusive===!0;if(e&&s)throw new I.ECSError(I.ECS_ERROR.RELATION_MODE_INVALID,"relations.register: a relation cannot be both exclusive and multi-target");const r=!e,i=t?.onDeleteTarget??l.DEFAULT_ON_DELETE_TARGET,n=r?this._host.pushSparseStore([l.RELATION_TARGET_FIELD],["f64"]):this._host.pushSparseStore([],[]),o=this._relations.length;return this._relations.push(l.createRelationStore(r,n,this._host.sparseStoreOf(n),i)),i!=="orphan"&&(this._hasTargetCleanup=!0),y.unsafeCast(o)}_relationOf(t){const e=t,s=this._relations[e];if(s===void 0)throw new I.ECSError(I.ECS_ERROR.RELATION_NOT_REGISTERED,`relation ${e} is not registered`);return s}addRelation(t,e,s){const r=this._relationOf(e);this._host.isAlive(t)&&this._host.isAlive(s)&&r.link(t,s)}removeRelation(t,e,s){const r=this._relationOf(e);this._host.isAlive(t)&&r.unlink(t,s)}targetOf(t,e){return this._relationOf(e).singleTargetAt(l.getEntityIndex(t))}targetsOf(t,e){return this._relationOf(e).targetsAt(l.getEntityIndex(t))}sourcesOf(t,e){return this._relationOf(e).sourcesOf(t)}hasRelation(t,e){return this._host.hasSparse(t,this._relationOf(e).sparse)}pairsOf(t){const e=this._relationOf(t),s=[],r=this._host.generations();return e.forEachCanonicalPair(i=>l.createEntityId(i,r[i]),(i,n)=>s.push([i,n])),s}sourcesOfAny(t){const e=[],s=this._relations;for(let r=0;r<s.length;r++){const i=y.unsafeCast(r),n=s[r].sourcesOf(t);for(let o=0;o<n.length;o++)e.push([i,n[o]])}return e}relationBackingSparseId(t){return this._relationOf(t).sparse}forEachTargetMatch(t,e,s,r,i,n){const{sparseIncludes:o,sparseExcludes:u,includesDisabled:a}=i,c=this._relations;if(c.length===0)return;const g=new Set;for(let h=0;h<c.length;h++){const f=c[h].sourcesOf(t);for(let p=0;p<f.length;p++)g.add(f[p])}if(g.size===0)return;const v=Array.from(g).sort((h,f)=>h-f),S=this._host.sparseStores(),R=this._host.entityArchetypes(),_=this._host.entityRows(),O=this._host.archetypes();for(let h=0;h<v.length;h++){const f=y.unsafeCast(v[h]),p=l.getEntityIndex(f),T=R[p];if(T===l.UNASSIGNED)continue;const C=O[T],A=C.mask;if(!A.contains(e)||s!==null&&A.overlaps(s)||r!==null&&!A.overlaps(r))continue;let x=!0;for(let d=0;d<o.length;d++)if(!S[o[d]].has(p)){x=!1;break}if(x){for(let d=0;d<u.length;d++)if(S[u[d]].has(p)){x=!1;break}if(x){if(!a){const d=_[p];if(d!==l.UNASSIGNED&&d>=C.enabledCount)continue}n(f)}}}}compactRelations(){const t=this._relations;if(t.length===0)return 0;const e=r=>this._host.isAlive(r);let s=0;for(let r=0;r<t.length;r++)s+=t[r].pruneDeadReverse(e);return s}ancestorsOf(t,e){const s=this._relationOf(e),r=this._host.sparseStoreOf(s.sparse),i=[t],n=new Set([l.getEntityIndex(t)]);let o=t;for(;;){const u=r.getField(l.getEntityIndex(o),0);if(u===void 0)break;const a=y.unsafeCast(u);if(!this._host.isAlive(a)){i.push(a);break}const c=l.getEntityIndex(a);if(n.has(c))break;n.add(c),o=a,i.push(o)}return i}rootOf(t,e){const s=this.ancestorsOf(t,e);return s[s.length-1]}cascadeOf(t,e){const s=this._relationOf(e),r=[t],i=new Set([l.getEntityIndex(t)]);for(let n=0;n<r.length;n++){const o=s.sourcesOf(r[n]);for(let u=0;u<o.length;u++){const a=o[u],c=l.getEntityIndex(a);i.has(c)||(i.add(c),r.push(a))}}return r}purgeSource(t){const e=this._relations;for(let s=0;s<e.length;s++)e[s].purgeSource(t)}cleanupTarget(t,e){const s=this._relations;for(let r=0;r<s.length;r++){const i=s[r];if(i.onDeleteTarget==="orphan")continue;const n=i.sourcesOf(t);if(n.length!==0){if(i.onDeleteTarget==="delete"){for(let o=0;o<n.length;o++)e.push(n[o]);continue}for(let o=0;o<n.length;o++)i.unlink(n[o],t)}}}forEachHierarchyMatch(t,e,s,r,i,n,o,u){const a=this._relationOf(n),c=[];if(this._host.forEachSparseMatch(t,e,s,r,i,_=>c.push(_)),c.length===0)return;this._hierarchyRadixOut=w.radixSortByIndex(c,this._hierarchyRadixOut,this._hierarchyRadixC0,this._hierarchyRadixC1);const g=this._host.sparseStoreOf(a.sparse),v=new Map,S=new Set,R=[];for(let _=0;_<c.length;_++){const O=c[_],h=this._hierarchyDepthOf(l.getEntityIndex(O),g,v,S);if(h>o)continue;let f=R[h];f===void 0&&(f=[],R[h]=f),f.push(O)}for(let _=0;_<R.length;_++){const O=R[_];if(O!==void 0)for(let h=0;h<O.length;h++)u(O[h])}}_hierarchyDepthOf(t,e,s,r){const i=[];let n=t,o=0;for(;;){const a=s.get(n);if(a!==void 0){o=a;break}const c=e.getField(n,0);let g=-1;if(c!==void 0){const v=y.unsafeCast(c);this._host.isAlive(v)&&(g=l.getEntityIndex(v))}if(g===-1){s.set(n,0),o=0;break}if(r.has(g)){s.set(n,0),o=0;break}i.push(n),r.add(n),n=g}let u=o;for(let a=i.length-1;a>=0;a--)u+=1,s.set(i[a],u),r.delete(i[a]);return s.get(t)}}class k{_service;constructor(t){this._service=t}register(t){return this._service.registerRelation(t)}get count(){return this._service.count}add(t,e,s){return this._service.addRelation(t,e,s),this}remove(t,e,s){return this._service.removeRelation(t,e,s),this}has(t,e){return this._service.hasRelation(t,e)}targetOf(t,e){return this._service.targetOf(t,e)}targetsOf(t,e){return this._service.targetsOf(t,e)}sourcesOf(t,e){return this._service.sourcesOf(t,e)}pairsOf(t){return this._service.pairsOf(t)}sourcesOfAny(t){return this._service.sourcesOfAny(t)}ancestorsOf(t,e){return this._service.ancestorsOf(t,e)}rootOf(t,e){return this._service.rootOf(t,e)}cascadeOf(t,e){return this._service.cascadeOf(t,e)}compact(){return this._service.compactRelations()}}function b(E,t){return E.relations.register({exclusive:!0,onDeleteTarget:t?.onDeleteTarget??"clear"})}function N(E,t){return E.relations.register({exclusive:!0,onDeleteTarget:t?.onDeleteTarget??"delete"})}function M(){return{name:"relations",install(E){const t=E.store,e=new D(t.relationHost());return t.installRelations(e),{relations:new k(e)}}}}exports.ECSRelations=k;exports.registerChildOf=N;exports.registerIsA=b;exports.relations=M;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./relations/index.cjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./relations/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./relation_store-RBhpcE28.cjs"),D=require("./arrays-Dt-Joc4i.cjs"),l=require("../index.development.cjs"),A=require("./assertions-z5GQd_bB.cjs");class N{constructor(e){this._host=e}_relations=[];_hasTargetCleanup=!1;_hierarchyRadixOut=new Uint32Array(1024);_hierarchyRadixC0=new Int32Array(1024);_hierarchyRadixC1=new Int32Array(1024);get stores(){return this._relations}get count(){return this._relations.length}get hasTargetCleanup(){return this._hasTargetCleanup}registerRelation(e){const t=e?.multi===!0,r=e?.exclusive===!0;if(t&&r)throw new l.ECSError(l.ECS_ERROR.RELATION_MODE_INVALID,"relations.register: a relation cannot be both exclusive and multi-target");const s=!t,i=e?.onDeleteTarget??a.DEFAULT_ON_DELETE_TARGET,n=s?this._host.pushSparseStore([a.RELATION_TARGET_FIELD],["f64"]):this._host.pushSparseStore([],[]),o=this._relations.length;return this._relations.push(a.createRelationStore(s,n,this._host.sparseStoreOf(n),i)),i!=="orphan"&&(this._hasTargetCleanup=!0),A.unsafeCast(o)}_relationOf(e){const t=e,r=this._relations[t];if(r===void 0)throw new l.ECSError(l.ECS_ERROR.RELATION_NOT_REGISTERED,`relation ${t} is not registered`);return r}addRelation(e,t,r){const s=this._relationOf(t);if(!this._host.isAlive(e))throw a.entityNotAliveError("addRelation",e,"source");if(!this._host.isAlive(r))throw a.entityNotAliveError("addRelation",r,"target");s.link(e,r)}removeRelation(e,t,r){const s=this._relationOf(t);if(!this._host.isAlive(e))throw a.entityNotAliveError("removeRelation",e,"source");s.unlink(e,r)}targetOf(e,t){const r=this._relationOf(t);{if(!r.exclusive)throw new l.ECSError(l.ECS_ERROR.RELATION_MODE_MISMATCH,"targetOf: relation is multi-target, use targetsOf");if(!this._host.isAlive(e))throw a.entityNotAliveError("targetOf",e)}return r.singleTargetAt(a.getEntityIndex(e))}targetsOf(e,t){const r=this._relationOf(t);if(!this._host.isAlive(e))throw a.entityNotAliveError("targetsOf",e);return r.targetsAt(a.getEntityIndex(e))}sourcesOf(e,t){return this._relationOf(t).sourcesOf(e)}hasRelation(e,t){return this._host.hasSparse(e,this._relationOf(t).sparse)}pairsOf(e){const t=this._relationOf(e),r=[],s=this._host.generations();return t.forEachCanonicalPair(i=>a.createEntityId(i,s[i]),(i,n)=>r.push([i,n])),r}sourcesOfAny(e){const t=[],r=this._relations;for(let s=0;s<r.length;s++){const i=A.unsafeCast(s),n=r[s].sourcesOf(e);for(let o=0;o<n.length;o++)t.push([i,n[o]])}return t}relationBackingSparseId(e){return this._relationOf(e).sparse}forEachTargetMatch(e,t,r,s,i,n){const{sparseIncludes:o,sparseExcludes:f,includesDisabled:c}=i,h=this._relations;if(h.length===0)return;const d=new Set;for(let u=0;u<h.length;u++){const _=h[u].sourcesOf(e);for(let R=0;R<_.length;R++)d.add(_[R])}if(d.size===0)return;const p=Array.from(d).sort((u,_)=>u-_),S=this._host.sparseStores(),y=this._host.entityArchetypes(),E=this._host.entityRows(),O=this._host.archetypes();for(let u=0;u<p.length;u++){const _=A.unsafeCast(p[u]),R=a.getEntityIndex(_),x=y[R];if(x===a.UNASSIGNED)continue;const w=O[x],I=w.mask;if(!I.contains(t)||r!==null&&I.overlaps(r)||s!==null&&!I.overlaps(s))continue;let C=!0;for(let g=0;g<o.length;g++)if(!S[o[g]].has(R)){C=!1;break}if(C){for(let g=0;g<f.length;g++)if(S[f[g]].has(R)){C=!1;break}if(C){if(!c){const g=E[R];if(g!==a.UNASSIGNED&&g>=w.enabledCount)continue}n(_)}}}}compactRelations(){const e=this._relations;if(e.length===0)return 0;const t=s=>this._host.isAlive(s);let r=0;for(let s=0;s<e.length;s++)r+=e[s].pruneDeadReverse(t);return r}ancestorsOf(e,t){const r=this._relationOf(t);{if(!r.exclusive)throw new l.ECSError(l.ECS_ERROR.RELATION_MODE_MISMATCH,"ancestorsOf: relation is multi-target, traversal needs an exclusive (parent) chain");if(!this._host.isAlive(e))throw a.entityNotAliveError("ancestorsOf",e)}const s=this._host.sparseStoreOf(r.sparse),i=[e],n=new Set([a.getEntityIndex(e)]);let o=e;for(;;){const f=s.getField(a.getEntityIndex(o),0);if(f===void 0)break;const c=A.unsafeCast(f);if(!this._host.isAlive(c)){i.push(c);break}const h=a.getEntityIndex(c);if(n.has(h))throw new l.ECSError(l.ECS_ERROR.RELATION_CYCLE,`ancestorsOf: cycle in relation chain at entity index ${h}`);n.add(h),o=c,i.push(o)}return i}rootOf(e,t){const r=this.ancestorsOf(e,t);return r[r.length-1]}cascadeOf(e,t){const r=this._relationOf(t);{if(!r.exclusive)throw new l.ECSError(l.ECS_ERROR.RELATION_MODE_MISMATCH,"cascadeOf: relation is multi-target, traversal needs an exclusive (parent) chain");if(!this._host.isAlive(e))throw a.entityNotAliveError("cascadeOf",e)}const s=[e],i=new Set([a.getEntityIndex(e)]);for(let n=0;n<s.length;n++){const o=r.sourcesOf(s[n]);for(let f=0;f<o.length;f++){const c=o[f],h=a.getEntityIndex(c);if(i.has(h))throw new l.ECSError(l.ECS_ERROR.RELATION_CYCLE,`cascadeOf: cycle in relation chain at entity index ${h}`);i.add(h),s.push(c)}}return s}purgeSource(e){const t=this._relations;for(let r=0;r<t.length;r++)t[r].purgeSource(e)}cleanupTarget(e,t){const r=this._relations;for(let s=0;s<r.length;s++){const i=r[s];if(i.onDeleteTarget==="orphan")continue;const n=i.sourcesOf(e);if(n.length!==0){if(i.onDeleteTarget==="delete"){for(let o=0;o<n.length;o++)t.push(n[o]);continue}for(let o=0;o<n.length;o++)i.unlink(n[o],e)}}}forEachHierarchyMatch(e,t,r,s,i,n,o,f){const c=this._relationOf(n);if(!c.exclusive)throw new l.ECSError(l.ECS_ERROR.RELATION_MODE_MISMATCH,"hierarchy(): relation is multi-target, depth ordering needs an exclusive (parent) chain");const h=[];if(this._host.forEachSparseMatch(e,t,r,s,i,E=>h.push(E)),h.length===0)return;this._hierarchyRadixOut=D.radixSortByIndex(h,this._hierarchyRadixOut,this._hierarchyRadixC0,this._hierarchyRadixC1);const d=this._host.sparseStoreOf(c.sparse),p=new Map,S=new Set,y=[];for(let E=0;E<h.length;E++){const O=h[E],u=this._hierarchyDepthOf(a.getEntityIndex(O),d,p,S);if(u>o)continue;let _=y[u];_===void 0&&(_=[],y[u]=_),_.push(O)}for(let E=0;E<y.length;E++){const O=y[E];if(O!==void 0)for(let u=0;u<O.length;u++)f(O[u])}}_hierarchyDepthOf(e,t,r,s){const i=[];let n=e,o=0;for(;;){const c=r.get(n);if(c!==void 0){o=c;break}const h=t.getField(n,0);let d=-1;if(h!==void 0){const p=A.unsafeCast(h);this._host.isAlive(p)&&(d=a.getEntityIndex(p))}if(d===-1){r.set(n,0),o=0;break}if(s.has(d))throw new l.ECSError(l.ECS_ERROR.RELATION_CYCLE,`hierarchy(): cycle in relation chain at entity index ${d}`);i.push(n),s.add(n),n=d}let f=o;for(let c=i.length-1;c>=0;c--)f+=1,r.set(i[c],f),s.delete(i[c]);return r.get(e)}}class T{_service;constructor(e){this._service=e}register(e){return this._service.registerRelation(e)}get count(){return this._service.count}add(e,t,r){return this._service.addRelation(e,t,r),this}remove(e,t,r){return this._service.removeRelation(e,t,r),this}has(e,t){return this._service.hasRelation(e,t)}targetOf(e,t){return this._service.targetOf(e,t)}targetsOf(e,t){return this._service.targetsOf(e,t)}sourcesOf(e,t){return this._service.sourcesOf(e,t)}pairsOf(e){return this._service.pairsOf(e)}sourcesOfAny(e){return this._service.sourcesOfAny(e)}ancestorsOf(e,t){return this._service.ancestorsOf(e,t)}rootOf(e,t){return this._service.rootOf(e,t)}cascadeOf(e,t){return this._service.cascadeOf(e,t)}compact(){return this._service.compactRelations()}}function M(v,e){return v.relations.register({exclusive:!0,onDeleteTarget:e?.onDeleteTarget??"clear"})}function k(v,e){return v.relations.register({exclusive:!0,onDeleteTarget:e?.onDeleteTarget??"delete"})}function L(){return{name:"relations",install(v){const e=v.store,t=new N(e.relationHost());return e.installRelations(t),{relations:new T(t)}}}}exports.ECSRelations=T;exports.registerChildOf=k;exports.registerIsA=M;exports.relations=L;
|