@adobe/data 0.8.6 → 0.9.1
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/dist/debug-type-test.js +12 -0
- package/dist/debug-type-test.js.map +1 -0
- package/dist/ecs/database/archetype-type-safety-test.d.ts +21 -0
- package/dist/ecs/database/archetype-type-safety-test.js +36 -0
- package/dist/ecs/database/archetype-type-safety-test.js.map +1 -0
- package/dist/ecs/database/calculate-system-order.d.ts +28 -0
- package/dist/ecs/database/calculate-system-order.js +239 -0
- package/dist/ecs/database/calculate-system-order.js.map +1 -0
- package/dist/ecs/database/calculate-system-order.test.js +396 -0
- package/dist/ecs/database/calculate-system-order.test.js.map +1 -0
- package/dist/ecs/database/create-database-schema-test.js +150 -0
- package/dist/ecs/database/create-database-schema-test.js.map +1 -0
- package/dist/ecs/database/create-plugin-v2.d.ts +79 -0
- package/dist/ecs/database/create-plugin-v2.js +68 -0
- package/dist/ecs/database/create-plugin-v2.js.map +1 -0
- package/dist/ecs/database/create-plugin-v2.test.js +362 -0
- package/dist/ecs/database/create-plugin-v2.test.js.map +1 -0
- package/dist/ecs/database/create-plugin.OLD.d.ts +138 -0
- package/dist/ecs/database/create-plugin.OLD.js +59 -0
- package/dist/ecs/database/create-plugin.OLD.js.map +1 -0
- package/dist/ecs/database/create-plugin.d.ts +69 -0
- package/dist/ecs/database/create-plugin.js +47 -0
- package/dist/ecs/database/create-plugin.js.map +1 -0
- package/dist/ecs/database/create-plugin.test.js +437 -0
- package/dist/ecs/database/create-plugin.test.js.map +1 -0
- package/dist/ecs/database/database-schema/create-database-schema.d.ts +3 -3
- package/dist/ecs/database/database-schema/database-schema.d.ts +4 -3
- package/dist/ecs/database/database-with-systems.test.js +292 -0
- package/dist/ecs/database/database-with-systems.test.js.map +1 -0
- package/dist/ecs/database/database.d.ts +63 -18
- package/dist/ecs/database/database.js +42 -0
- package/dist/ecs/database/database.js.map +1 -1
- package/dist/ecs/database/database.plugin.create.test.OLD.js +601 -0
- package/dist/ecs/database/database.plugin.create.test.OLD.js.map +1 -0
- package/dist/ecs/database/database.plugin.create.test.js +321 -0
- package/dist/ecs/database/database.plugin.create.test.js.map +1 -0
- package/dist/ecs/database/database.plugin.test.js +90 -0
- package/dist/ecs/database/database.plugin.test.js.map +1 -0
- package/dist/ecs/database/database.test copy.js +199 -0
- package/dist/ecs/database/database.test copy.js.map +1 -0
- package/dist/ecs/database/database.test.js +200 -0
- package/dist/ecs/database/database.test.js.map +1 -0
- package/dist/ecs/database/multi-param-inference-poc.test.js +96 -0
- package/dist/ecs/database/multi-param-inference-poc.test.js.map +1 -0
- package/dist/ecs/database/observe-select-entities.test.js +3 -3
- package/dist/ecs/database/observe-select-entities.test.js.map +1 -1
- package/dist/ecs/database/observed/create-observed-database.js +6 -1
- package/dist/ecs/database/observed/create-observed-database.js.map +1 -1
- package/dist/ecs/database/observed/create-observed-database.test.js +105 -49
- package/dist/ecs/database/observed/create-observed-database.test.js.map +1 -1
- package/dist/ecs/database/observed/observed-database.d.ts +3 -0
- package/dist/ecs/database/old-plugin-create-with-dependencies-array.d.ts +61 -0
- package/dist/ecs/database/old-plugin-create-with-dependencies-array.js +76 -0
- package/dist/ecs/database/old-plugin-create-with-dependencies-array.js.map +1 -0
- package/dist/ecs/database/overload-inference-poc.test.js +109 -0
- package/dist/ecs/database/overload-inference-poc.test.js.map +1 -0
- package/dist/ecs/database/public/create-database-from-schema.test.js +153 -0
- package/dist/ecs/database/public/create-database-from-schema.test.js.map +1 -0
- package/dist/ecs/database/public/create-database.d.ts +18 -2
- package/dist/ecs/database/public/create-database.js +283 -79
- package/dist/ecs/database/public/create-database.js.map +1 -1
- package/dist/ecs/database/public/create-database.test.js +178 -47
- package/dist/ecs/database/public/create-database.test.js.map +1 -1
- package/dist/ecs/database/reconciling/create-reconciling-database.d.ts +2 -2
- package/dist/ecs/database/reconciling/create-reconciling-database.js +7 -2
- package/dist/ecs/database/reconciling/create-reconciling-database.js.map +1 -1
- package/dist/ecs/database/reconciling/create-reconciling-database.test.js +18 -9
- package/dist/ecs/database/reconciling/create-reconciling-database.test.js.map +1 -1
- package/dist/ecs/database/reconciling/reconciling-database.d.ts +5 -3
- package/dist/ecs/database/schedule-type-check-demo.d.ts +10 -0
- package/dist/ecs/database/schedule-type-check-demo.js +71 -0
- package/dist/ecs/database/schedule-type-check-demo.js.map +1 -0
- package/dist/ecs/database/test-archetype-validation.d.ts +9 -0
- package/dist/ecs/database/test-archetype-validation.js +14 -0
- package/dist/ecs/database/test-archetype-validation.js.map +1 -0
- package/dist/ecs/database/test-exactkeys.js +17 -0
- package/dist/ecs/database/test-exactkeys.js.map +1 -0
- package/dist/ecs/database/transactional-store/{coalesce-transactions.js → coalesce-actions.js} +1 -1
- package/dist/ecs/database/transactional-store/coalesce-actions.js.map +1 -0
- package/dist/ecs/database/transactional-store/coalesce-actions.test.js +433 -0
- package/dist/ecs/database/transactional-store/coalesce-actions.test.js.map +1 -0
- package/dist/ecs/database/transactional-store/coalesce-transactions.test.js +3 -3
- package/dist/ecs/database/transactional-store/coalesce-transactions.test.js.map +1 -1
- package/dist/ecs/database/transactional-store/create-transactional-store.js +18 -2
- package/dist/ecs/database/transactional-store/create-transactional-store.js.map +1 -1
- package/dist/ecs/database/transactional-store/create-transactional-store.test.js +13 -3
- package/dist/ecs/database/transactional-store/create-transactional-store.test.js.map +1 -1
- package/dist/ecs/database/transactional-store/transactional-store.d.ts +2 -0
- package/dist/ecs/database/type-inference-demo.d.ts +75 -0
- package/dist/ecs/database/type-inference-demo.js +73 -0
- package/dist/ecs/database/type-inference-demo.js.map +1 -0
- package/dist/ecs/database/type-inference-example.js +2 -0
- package/dist/ecs/database/type-inference-example.js.map +1 -0
- package/dist/ecs/database/type-inference-poc.test.js +73 -0
- package/dist/ecs/database/type-inference-poc.test.js.map +1 -0
- package/dist/ecs/index.d.ts +3 -0
- package/dist/ecs/index.js +2 -0
- package/dist/ecs/index.js.map +1 -1
- package/dist/ecs/plugins/index.d.ts +1 -0
- package/dist/{math/i32/constants → ecs/plugins}/index.js +1 -1
- package/dist/ecs/plugins/index.js.map +1 -0
- package/dist/ecs/plugins/scheduler/create-scheduler-plugin.d.ts +8 -0
- package/dist/ecs/plugins/scheduler/create-scheduler-plugin.js +54 -0
- package/dist/ecs/plugins/scheduler/create-scheduler-plugin.js.map +1 -0
- package/dist/ecs/plugins/scheduler/create-scheduler-plugin.test.js +198 -0
- package/dist/ecs/plugins/scheduler/create-scheduler-plugin.test.js.map +1 -0
- package/dist/ecs/plugins/scheduler/index.d.ts +1 -0
- package/dist/{math/f32/constants → ecs/plugins/scheduler}/index.js +1 -1
- package/dist/ecs/plugins/scheduler/index.js.map +1 -0
- package/dist/ecs/plugins/scheduler/scheduler.d.ts +7 -0
- package/dist/ecs/plugins/scheduler/scheduler.js +52 -0
- package/dist/ecs/plugins/scheduler/scheduler.js.map +1 -0
- package/dist/ecs/plugins/scheduler/type-inference-test.js +2 -0
- package/dist/ecs/plugins/scheduler/type-inference-test.js.map +1 -0
- package/dist/ecs/store/action-functions.d.ts +21 -0
- package/dist/ecs/store/action-functions.js +2 -0
- package/dist/ecs/store/action-functions.js.map +1 -0
- package/dist/ecs/store/create-store-schema-test.js +70 -8
- package/dist/ecs/store/create-store-schema-test.js.map +1 -1
- package/dist/ecs/store/entity-functions.d.ts +7 -0
- package/dist/ecs/store/entity-functions.js +2 -0
- package/dist/ecs/store/entity-functions.js.map +1 -0
- package/dist/ecs/store/functions.d.ts +2 -0
- package/dist/ecs/store/functions.js +2 -0
- package/dist/ecs/store/functions.js.map +1 -0
- package/dist/ecs/store/public/create-store.js +9 -8
- package/dist/ecs/store/public/create-store.js.map +1 -1
- package/dist/ecs/store/public/create-store.test.js +5 -0
- package/dist/ecs/store/public/create-store.test.js.map +1 -1
- package/dist/ecs/store/store.d.ts +46 -13
- package/dist/ecs/store/store.js +35 -2
- package/dist/ecs/store/store.js.map +1 -1
- package/dist/ecs/store/store.test.js +211 -0
- package/dist/ecs/store/store.test.js.map +1 -0
- package/dist/ecs/system/system-declaration.d.ts +7 -0
- package/dist/{math/aabb/functions.js → ecs/system/system-declaration.js} +1 -1
- package/dist/ecs/system/system-declaration.js.map +1 -0
- package/dist/ecs/system/system-declarations.d.ts +4 -0
- package/dist/ecs/system/system-declarations.js +23 -0
- package/dist/ecs/system/system-declarations.js.map +1 -0
- package/dist/ecs/system/system-factory/public/create copy.d.ts +12 -0
- package/dist/ecs/system/system-factory/public/create copy.js +8 -0
- package/dist/ecs/system/system-factory/public/create copy.js.map +1 -0
- package/dist/ecs/system/system-factory/public/create.d.ts +12 -0
- package/dist/ecs/system/system-factory/public/create.js +8 -0
- package/dist/ecs/system/system-factory/public/create.js.map +1 -0
- package/dist/ecs/system/system-factory/public/create.test.js +42 -0
- package/dist/ecs/system/system-factory/public/create.test.js.map +1 -0
- package/dist/ecs/system/system-factory/public/index.d.ts +1 -0
- package/dist/ecs/system/system-factory/public/index.js +2 -0
- package/dist/ecs/system/system-factory/public/index.js.map +1 -0
- package/dist/ecs/system/system-factory/system-factory.d.ts +17 -0
- package/dist/ecs/{store/public/schema/schema.js → system/system-factory/system-factory.js} +2 -2
- package/dist/ecs/system/system-factory/system-factory.js.map +1 -0
- package/dist/ecs/system/system-factory.d.ts +9 -0
- package/dist/{math/picking/pick-result.js → ecs/system/system-factory.js} +1 -1
- package/dist/ecs/system/system-factory.js.map +1 -0
- package/dist/ecs/system/system-interface.d.ts +5 -0
- package/dist/ecs/system/system-interface.js +2 -0
- package/dist/ecs/system/system-interface.js.map +1 -0
- package/dist/ecs/system/system.d.ts +4 -0
- package/dist/ecs/{store/constants/types.js → system/system.js} +1 -1
- package/dist/ecs/system/system.js.map +1 -0
- package/dist/ecs/system/systems-type.d.ts +2 -0
- package/dist/ecs/system/systems-type.js +2 -0
- package/dist/ecs/system/systems-type.js.map +1 -0
- package/dist/ecs/system/systems.d.ts +2 -0
- package/dist/ecs/{store/public/types.js → system/systems.js} +1 -1
- package/dist/ecs/system/systems.js.map +1 -0
- package/dist/ecs/system/world-schema/public/create.d.ts +12 -0
- package/dist/ecs/system/world-schema/public/create.js +8 -0
- package/dist/ecs/system/world-schema/public/create.js.map +1 -0
- package/dist/ecs/system/world-schema/public/create.test.js +42 -0
- package/dist/ecs/system/world-schema/public/create.test.js.map +1 -0
- package/dist/ecs/system/world-schema/public/index.d.ts +1 -0
- package/dist/ecs/system/world-schema/public/index.js +2 -0
- package/dist/ecs/system/world-schema/public/index.js.map +1 -0
- package/dist/ecs/system/world-schema/system-factory.d.ts +17 -0
- package/dist/ecs/system/world-schema/system-factory.js +23 -0
- package/dist/ecs/system/world-schema/system-factory.js.map +1 -0
- package/dist/ecs/undo-redo-service/create-undo-redo-service.js +1 -1
- package/dist/ecs/undo-redo-service/create-undo-redo-service.js.map +1 -1
- package/dist/ecs/world/calculate-system-order.d.ts +18 -0
- package/dist/ecs/world/calculate-system-order.js +113 -0
- package/dist/ecs/world/calculate-system-order.js.map +1 -0
- package/dist/ecs/world/calculate-system-order.test.js +168 -0
- package/dist/ecs/world/calculate-system-order.test.js.map +1 -0
- package/dist/ecs/world/create-world-schema-test.js +294 -0
- package/dist/ecs/world/create-world-schema-test.js.map +1 -0
- package/dist/ecs/world/create-world-type-test.d.ts +1 -0
- package/dist/ecs/world/create-world-type-test.js +129 -0
- package/dist/ecs/world/create-world-type-test.js.map +1 -0
- package/dist/ecs/world/create-world.d.ts +17 -5
- package/dist/ecs/world/create-world.js +75 -108
- package/dist/ecs/world/create-world.js.map +1 -1
- package/dist/ecs/world/create-world.test.js +227 -434
- package/dist/ecs/world/create-world.test.js.map +1 -1
- package/dist/ecs/world/public/world-schema/public/create.d.ts +12 -0
- package/dist/ecs/world/public/world-schema/public/create.js +8 -0
- package/dist/ecs/world/public/world-schema/public/create.js.map +1 -0
- package/dist/ecs/world/public/world-schema/public/create.test.d.ts +1 -0
- package/dist/ecs/world/public/world-schema/public/create.test.js +42 -0
- package/dist/ecs/world/public/world-schema/public/create.test.js.map +1 -0
- package/dist/ecs/world/public/world-schema/public/index.d.ts +1 -0
- package/dist/ecs/world/public/world-schema/public/index.js +2 -0
- package/dist/ecs/world/public/world-schema/public/index.js.map +1 -0
- package/dist/ecs/world/public/world-schema/world-schema.d.ts +17 -0
- package/dist/ecs/{store/public/schema/public.js → world/public/world-schema/world-schema.js} +2 -2
- package/dist/ecs/world/public/world-schema/world-schema.js.map +1 -0
- package/dist/ecs/world/system-declaration.d.ts +1 -0
- package/dist/ecs/world/system-declaration.js +23 -0
- package/dist/ecs/world/system-declaration.js.map +1 -0
- package/dist/ecs/world/system-schedule-typing-test.d.ts +1 -0
- package/dist/ecs/world/system-schedule-typing-test.js +83 -0
- package/dist/ecs/world/system-schedule-typing-test.js.map +1 -0
- package/dist/ecs/world/world-schema/public/create.d.ts +12 -0
- package/dist/ecs/world/world-schema/public/create.js +10 -0
- package/dist/ecs/world/world-schema/public/create.js.map +1 -0
- package/dist/ecs/world/world-schema/public/create.test.d.ts +1 -0
- package/dist/ecs/world/world-schema/public/create.test.js +41 -0
- package/dist/ecs/world/world-schema/public/create.test.js.map +1 -0
- package/dist/ecs/world/world-schema/public/index.d.ts +1 -0
- package/dist/ecs/world/world-schema/public/index.js +2 -0
- package/dist/ecs/world/world-schema/public/index.js.map +1 -0
- package/dist/ecs/world/world-schema/system-factory.d.ts +17 -0
- package/dist/ecs/world/world-schema/system-factory.js +23 -0
- package/dist/ecs/world/world-schema/system-factory.js.map +1 -0
- package/dist/ecs/world/world-schema/world-schema.d.ts +17 -16
- package/dist/ecs/world/world-schema/world-schema.js +1 -1
- package/dist/ecs/world/world-schema/world-schema.js.map +1 -1
- package/dist/ecs/world/world.d.ts +85 -10
- package/dist/ecs/world/world.js +80 -1
- package/dist/ecs/world/world.js.map +1 -1
- package/dist/ecs/world/world.test.d.ts +1 -0
- package/dist/ecs/world/world.test.js +176 -0
- package/dist/ecs/world/world.test.js.map +1 -0
- package/dist/lit/hooks/use-drag-transaction.d.ts +1 -1
- package/dist/old-ecs/ecs/ecs.test.js +1 -0
- package/dist/old-ecs/ecs/ecs.test.js.map +1 -1
- package/dist/samples/todo/services/main-service/todo-main-service.d.ts +1 -1
- package/dist/samples/todo/services/state-service/create-todo-database.d.ts +2 -2
- package/dist/samples/todo/services/state-service/create-todo-database.js +2 -2
- package/dist/samples/todo/services/state-service/create-todo-database.js.map +1 -1
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.js +1 -1
- package/dist/samples/todo/services/state-service/transactions/toggle-complete.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/types.d.ts +2 -0
- package/dist/types/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/blob/download-handle.d.ts +0 -4
- package/dist/blob/download-handle.js +0 -2
- package/dist/blob/download-handle.js.map +0 -1
- package/dist/blob/upload-handle.d.ts +0 -4
- package/dist/blob/upload-handle.js +0 -2
- package/dist/blob/upload-handle.js.map +0 -1
- package/dist/ecs/database/create-database.d.ts +0 -7
- package/dist/ecs/database/create-database.js +0 -186
- package/dist/ecs/database/create-database.js.map +0 -1
- package/dist/ecs/database/create-database.test.js +0 -903
- package/dist/ecs/database/create-database.test.js.map +0 -1
- package/dist/ecs/database/replicate.d.ts +0 -9
- package/dist/ecs/database/replicate.js +0 -66
- package/dist/ecs/database/replicate.js.map +0 -1
- package/dist/ecs/database/replicate.test.js +0 -235
- package/dist/ecs/database/replicate.test.js.map +0 -1
- package/dist/ecs/database/transactional-store/coalesce-transactions.js.map +0 -1
- package/dist/ecs/database/transactional-store/entity-id-preservation.test.js +0 -106
- package/dist/ecs/database/transactional-store/entity-id-preservation.test.js.map +0 -1
- package/dist/ecs/entity/entity.d.ts +0 -8
- package/dist/ecs/entity/entity.js +0 -3
- package/dist/ecs/entity/entity.js.map +0 -1
- package/dist/ecs/entity/u32.d.ts +0 -8
- package/dist/ecs/entity/u32.js +0 -24
- package/dist/ecs/entity/u32.js.map +0 -1
- package/dist/ecs/store/constants/functions.d.ts +0 -14
- package/dist/ecs/store/constants/functions.js +0 -31
- package/dist/ecs/store/constants/functions.js.map +0 -1
- package/dist/ecs/store/constants/index.d.ts +0 -2
- package/dist/ecs/store/constants/index.js +0 -24
- package/dist/ecs/store/constants/index.js.map +0 -1
- package/dist/ecs/store/constants/types.d.ts +0 -18
- package/dist/ecs/store/constants/types.js.map +0 -1
- package/dist/ecs/store/create-store.d.ts +0 -8
- package/dist/ecs/store/create-store.js +0 -126
- package/dist/ecs/store/create-store.js.map +0 -1
- package/dist/ecs/store/create-store.test.js +0 -725
- package/dist/ecs/store/create-store.test.js.map +0 -1
- package/dist/ecs/store/public/create-from-schema.d.ts +0 -6
- package/dist/ecs/store/public/create-from-schema.js +0 -26
- package/dist/ecs/store/public/create-from-schema.js.map +0 -1
- package/dist/ecs/store/public/index.d.ts +0 -3
- package/dist/ecs/store/public/index.js +0 -25
- package/dist/ecs/store/public/index.js.map +0 -1
- package/dist/ecs/store/public/readonly.d.ts +0 -19
- package/dist/ecs/store/public/readonly.js +0 -2
- package/dist/ecs/store/public/readonly.js.map +0 -1
- package/dist/ecs/store/public/schema/create-from-schema.d.ts +0 -6
- package/dist/ecs/store/public/schema/create-from-schema.js +0 -26
- package/dist/ecs/store/public/schema/create-from-schema.js.map +0 -1
- package/dist/ecs/store/public/schema/create.d.ts +0 -10
- package/dist/ecs/store/public/schema/create.js +0 -25
- package/dist/ecs/store/public/schema/create.js.map +0 -1
- package/dist/ecs/store/public/schema/createFromSchema.d.ts +0 -6
- package/dist/ecs/store/public/schema/createFromSchema.js +0 -5
- package/dist/ecs/store/public/schema/createFromSchema.js.map +0 -1
- package/dist/ecs/store/public/schema/public.d.ts +0 -1
- package/dist/ecs/store/public/schema/public.js.map +0 -1
- package/dist/ecs/store/public/schema/schema.d.ts +0 -11
- package/dist/ecs/store/public/schema/schema.js.map +0 -1
- package/dist/ecs/store/public/types.d.ts +0 -11
- package/dist/ecs/store/public/types.js.map +0 -1
- package/dist/ecs/store/store-schema/create-store-schema-test.js +0 -33
- package/dist/ecs/store/store-schema/create-store-schema-test.js.map +0 -1
- package/dist/ecs/store/store-schema/create-store-schema.js +0 -45
- package/dist/ecs/store/store-schema/create-store-schema.js.map +0 -1
- package/dist/ecs/store/store-schema/index.js +0 -21
- package/dist/ecs/store/store-schema/index.js.map +0 -1
- package/dist/ecs/store/store-schema/store-schema.js +0 -57
- package/dist/ecs/store/store-schema/store-schema.js.map +0 -1
- package/dist/ecs/world/index.d.ts +0 -5
- package/dist/ecs/world/index.js +0 -27
- package/dist/ecs/world/index.js.map +0 -1
- package/dist/ecs/world/system-phase.d.ts +0 -5
- package/dist/ecs/world/system-phase.js +0 -14
- package/dist/ecs/world/system-phase.js.map +0 -1
- package/dist/ecs/world/system.d.ts +0 -25
- package/dist/ecs/world/system.js +0 -2
- package/dist/ecs/world/system.js.map +0 -1
- package/dist/ecs/world/world-schema/create-world-schema-test.js +0 -55
- package/dist/ecs/world/world-schema/create-world-schema-test.js.map +0 -1
- package/dist/ecs/world/world-schema/create-world-schema.d.ts +0 -19
- package/dist/ecs/world/world-schema/create-world-schema.js +0 -33
- package/dist/ecs/world/world-schema/create-world-schema.js.map +0 -1
- package/dist/ecs/world/world-schema/index.d.ts +0 -2
- package/dist/ecs/world/world-schema/index.js +0 -24
- package/dist/ecs/world/world-schema/index.js.map +0 -1
- package/dist/graphics/camera/camera.d.ts +0 -62
- package/dist/graphics/camera/camera.js +0 -17
- package/dist/graphics/camera/camera.js.map +0 -1
- package/dist/graphics/camera/index.d.ts +0 -4
- package/dist/graphics/camera/index.js +0 -5
- package/dist/graphics/camera/index.js.map +0 -1
- package/dist/graphics/camera/screen-to-world-ray.d.ts +0 -12
- package/dist/graphics/camera/screen-to-world-ray.js +0 -49
- package/dist/graphics/camera/screen-to-world-ray.js.map +0 -1
- package/dist/graphics/camera/screen-to-world-ray.test.js +0 -171
- package/dist/graphics/camera/screen-to-world-ray.test.js.map +0 -1
- package/dist/graphics/camera/to-view-projection.d.ts +0 -3
- package/dist/graphics/camera/to-view-projection.js +0 -8
- package/dist/graphics/camera/to-view-projection.js.map +0 -1
- package/dist/graphics/camera/world-to-screen.d.ts +0 -12
- package/dist/graphics/camera/world-to-screen.js +0 -38
- package/dist/graphics/camera/world-to-screen.js.map +0 -1
- package/dist/graphics/camera/world-to-screen.test.js +0 -124
- package/dist/graphics/camera/world-to-screen.test.js.map +0 -1
- package/dist/graphics/create-struct-gpu-buffer.d.ts +0 -7
- package/dist/graphics/create-struct-gpu-buffer.js +0 -17
- package/dist/graphics/create-struct-gpu-buffer.js.map +0 -1
- package/dist/graphics/extract-wgsl-bindings.d.ts +0 -5
- package/dist/graphics/extract-wgsl-bindings.js +0 -10
- package/dist/graphics/extract-wgsl-bindings.js.map +0 -1
- package/dist/graphics/frame.js +0 -15
- package/dist/graphics/frame.js.map +0 -1
- package/dist/graphics/get-web-gpu-device-and-context.js +0 -24
- package/dist/graphics/get-web-gpu-device-and-context.js.map +0 -1
- package/dist/graphics/graphics-context.js +0 -7
- package/dist/graphics/graphics-context.js.map +0 -1
- package/dist/graphics/index.d.ts +0 -5
- package/dist/graphics/index.js +0 -5
- package/dist/graphics/index.js.map +0 -1
- package/dist/graphics/to-gpu-buffer.d.ts +0 -2
- package/dist/graphics/to-gpu-buffer.js +0 -14
- package/dist/graphics/to-gpu-buffer.js.map +0 -1
- package/dist/internal/array-buffer-like/grow.d.ts +0 -1
- package/dist/internal/array-buffer-like/grow.js +0 -9
- package/dist/internal/array-buffer-like/grow.js.map +0 -1
- package/dist/math/aabb/aabb.d.ts +0 -3
- package/dist/math/aabb/aabb.js +0 -2
- package/dist/math/aabb/aabb.js.map +0 -1
- package/dist/math/aabb/constants/functions.d.ts +0 -15
- package/dist/math/aabb/constants/functions.js +0 -76
- package/dist/math/aabb/constants/functions.js.map +0 -1
- package/dist/math/aabb/constants/index.d.ts +0 -3
- package/dist/math/aabb/constants/index.js +0 -25
- package/dist/math/aabb/constants/index.js.map +0 -1
- package/dist/math/aabb/constants/layout.d.ts +0 -1
- package/dist/math/aabb/constants/layout.js +0 -25
- package/dist/math/aabb/constants/layout.js.map +0 -1
- package/dist/math/aabb/constants/schema.d.ts +0 -33
- package/dist/math/aabb/constants/schema.js +0 -37
- package/dist/math/aabb/constants/schema.js.map +0 -1
- package/dist/math/aabb/functions.js.map +0 -1
- package/dist/math/aabb/lineIntersection.d.ts +0 -10
- package/dist/math/aabb/lineIntersection.js +0 -42
- package/dist/math/aabb/lineIntersection.js.map +0 -1
- package/dist/math/aabb-face/aabb-face.d.ts +0 -4
- package/dist/math/aabb-face/aabb-face.js +0 -23
- package/dist/math/aabb-face/aabb-face.js.map +0 -1
- package/dist/math/aabb-face/aabb-face.test.js +0 -54
- package/dist/math/aabb-face/aabb-face.test.js.map +0 -1
- package/dist/math/aabb-face/constants/functions.d.ts +0 -47
- package/dist/math/aabb-face/constants/functions.js +0 -148
- package/dist/math/aabb-face/constants/functions.js.map +0 -1
- package/dist/math/aabb-face/constants/index.d.ts +0 -2
- package/dist/math/aabb-face/constants/index.js +0 -24
- package/dist/math/aabb-face/constants/index.js.map +0 -1
- package/dist/math/aabb-face/constants/schema.d.ts +0 -5
- package/dist/math/aabb-face/constants/schema.js +0 -27
- package/dist/math/aabb-face/constants/schema.js.map +0 -1
- package/dist/math/aabb-face/face.d.ts +0 -51
- package/dist/math/aabb-face/face.js +0 -110
- package/dist/math/aabb-face/face.js.map +0 -1
- package/dist/math/aabb-face/face.test.js +0 -94
- package/dist/math/aabb-face/face.test.js.map +0 -1
- package/dist/math/aabb-face/functions.d.ts +0 -47
- package/dist/math/aabb-face/functions.js +0 -148
- package/dist/math/aabb-face/functions.js.map +0 -1
- package/dist/math/aabb-face/index.d.ts +0 -4
- package/dist/math/aabb-face/index.js +0 -23
- package/dist/math/aabb-face/index.js.map +0 -1
- package/dist/math/aabb-face/public.d.ts +0 -2
- package/dist/math/aabb-face/public.js +0 -24
- package/dist/math/aabb-face/public.js.map +0 -1
- package/dist/math/aabb-face/schema.d.ts +0 -5
- package/dist/math/aabb-face/schema.js +0 -27
- package/dist/math/aabb-face/schema.js.map +0 -1
- package/dist/math/box/box.d.ts +0 -50
- package/dist/math/box/box.js +0 -23
- package/dist/math/box/box.js.map +0 -1
- package/dist/math/f32/constants/index.d.ts +0 -1
- package/dist/math/f32/constants/index.js.map +0 -1
- package/dist/math/f32/constants/schema.d.ts +0 -5
- package/dist/math/f32/constants/schema.js +0 -24
- package/dist/math/f32/constants/schema.js.map +0 -1
- package/dist/math/f32/f32.d.ts +0 -4
- package/dist/math/f32/f32.js +0 -23
- package/dist/math/f32/f32.js.map +0 -1
- package/dist/math/face/face.d.ts +0 -51
- package/dist/math/face/face.js +0 -110
- package/dist/math/face/face.js.map +0 -1
- package/dist/math/face/face.test.js +0 -94
- package/dist/math/face/face.test.js.map +0 -1
- package/dist/math/i32/constants/index.d.ts +0 -1
- package/dist/math/i32/constants/index.js.map +0 -1
- package/dist/math/i32/constants/schema.d.ts +0 -6
- package/dist/math/i32/constants/schema.js +0 -24
- package/dist/math/i32/constants/schema.js.map +0 -1
- package/dist/math/i32/i32.d.ts +0 -4
- package/dist/math/i32/i32.js +0 -23
- package/dist/math/i32/i32.js.map +0 -1
- package/dist/math/line2/constants/functions.d.ts +0 -5
- package/dist/math/line2/constants/functions.js +0 -61
- package/dist/math/line2/constants/functions.js.map +0 -1
- package/dist/math/line2/constants/index.d.ts +0 -3
- package/dist/math/line2/constants/index.js +0 -25
- package/dist/math/line2/constants/index.js.map +0 -1
- package/dist/math/line2/constants/layout.d.ts +0 -1
- package/dist/math/line2/constants/layout.js +0 -25
- package/dist/math/line2/constants/layout.js.map +0 -1
- package/dist/math/line2/constants/schema.d.ts +0 -33
- package/dist/math/line2/constants/schema.js +0 -37
- package/dist/math/line2/constants/schema.js.map +0 -1
- package/dist/math/line2/line2.d.ts +0 -4
- package/dist/math/line2/line2.js +0 -23
- package/dist/math/line2/line2.js.map +0 -1
- package/dist/math/line3/constants/functions.d.ts +0 -17
- package/dist/math/line3/constants/functions.js +0 -70
- package/dist/math/line3/constants/functions.js.map +0 -1
- package/dist/math/line3/constants/index.d.ts +0 -3
- package/dist/math/line3/constants/index.js +0 -25
- package/dist/math/line3/constants/index.js.map +0 -1
- package/dist/math/line3/constants/layout.d.ts +0 -1
- package/dist/math/line3/constants/layout.js +0 -25
- package/dist/math/line3/constants/layout.js.map +0 -1
- package/dist/math/line3/constants/schema.d.ts +0 -33
- package/dist/math/line3/constants/schema.js +0 -37
- package/dist/math/line3/constants/schema.js.map +0 -1
- package/dist/math/line3/line3.d.ts +0 -4
- package/dist/math/line3/line3.js +0 -23
- package/dist/math/line3/line3.js.map +0 -1
- package/dist/math/mat4x4/constants/functions.d.ts +0 -23
- package/dist/math/mat4x4/constants/functions.js +0 -236
- package/dist/math/mat4x4/constants/functions.js.map +0 -1
- package/dist/math/mat4x4/constants/index.d.ts +0 -3
- package/dist/math/mat4x4/constants/index.js +0 -25
- package/dist/math/mat4x4/constants/index.js.map +0 -1
- package/dist/math/mat4x4/constants/layout.d.ts +0 -1
- package/dist/math/mat4x4/constants/layout.js +0 -25
- package/dist/math/mat4x4/constants/layout.js.map +0 -1
- package/dist/math/mat4x4/constants/schema.d.ts +0 -11
- package/dist/math/mat4x4/constants/schema.js +0 -30
- package/dist/math/mat4x4/constants/schema.js.map +0 -1
- package/dist/math/mat4x4/mat4x4.d.ts +0 -26
- package/dist/math/mat4x4/mat4x4.js +0 -45
- package/dist/math/mat4x4/mat4x4.js.map +0 -1
- package/dist/math/picking/face.js +0 -2
- package/dist/math/picking/face.js.map +0 -1
- package/dist/math/picking/get-closest-entity-to-line.d.ts +0 -4
- package/dist/math/picking/get-closest-entity-to-line.js +0 -30
- package/dist/math/picking/get-closest-entity-to-line.js.map +0 -1
- package/dist/math/picking/get-closest-entity-to-point.d.ts +0 -4
- package/dist/math/picking/get-closest-entity-to-point.js +0 -27
- package/dist/math/picking/get-closest-entity-to-point.js.map +0 -1
- package/dist/math/picking/get-intersecting-entities.d.ts +0 -12
- package/dist/math/picking/get-intersecting-entities.js +0 -15
- package/dist/math/picking/get-intersecting-entities.js.map +0 -1
- package/dist/math/picking/getClosestEntityToLine.d.ts +0 -4
- package/dist/math/picking/getClosestEntityToLine.js +0 -29
- package/dist/math/picking/getClosestEntityToLine.js.map +0 -1
- package/dist/math/picking/getClosestEntityToPoint.d.ts +0 -4
- package/dist/math/picking/getClosestEntityToPoint.js +0 -27
- package/dist/math/picking/getClosestEntityToPoint.js.map +0 -1
- package/dist/math/picking/getIntersectingEntities.d.ts +0 -12
- package/dist/math/picking/getIntersectingEntities.js +0 -15
- package/dist/math/picking/getIntersectingEntities.js.map +0 -1
- package/dist/math/picking/index.d.ts +0 -5
- package/dist/math/picking/index.js +0 -27
- package/dist/math/picking/index.js.map +0 -1
- package/dist/math/picking/pick-from-tables.d.ts +0 -19
- package/dist/math/picking/pick-from-tables.js +0 -63
- package/dist/math/picking/pick-from-tables.js.map +0 -1
- package/dist/math/picking/pick-result.d.ts +0 -12
- package/dist/math/picking/pick-result.js.map +0 -1
- package/dist/math/plane/constants/functions.d.ts +0 -16
- package/dist/math/plane/constants/functions.js +0 -54
- package/dist/math/plane/constants/functions.js.map +0 -1
- package/dist/math/plane/constants/index.d.ts +0 -3
- package/dist/math/plane/constants/index.js +0 -25
- package/dist/math/plane/constants/index.js.map +0 -1
- package/dist/math/plane/constants/layout.d.ts +0 -1
- package/dist/math/plane/constants/layout.js +0 -25
- package/dist/math/plane/constants/layout.js.map +0 -1
- package/dist/math/plane/constants/schema.d.ts +0 -24
- package/dist/math/plane/constants/schema.js +0 -33
- package/dist/math/plane/constants/schema.js.map +0 -1
- package/dist/math/plane/plane.d.ts +0 -4
- package/dist/math/plane/plane.js +0 -23
- package/dist/math/plane/plane.js.map +0 -1
- package/dist/math/quat/constants/index.d.ts +0 -3
- package/dist/math/quat/constants/index.js +0 -25
- package/dist/math/quat/constants/index.js.map +0 -1
- package/dist/math/quat/constants/layout.d.ts +0 -1
- package/dist/math/quat/constants/layout.js +0 -25
- package/dist/math/quat/constants/layout.js.map +0 -1
- package/dist/math/quat/constants/schema.d.ts +0 -11
- package/dist/math/quat/constants/schema.js +0 -30
- package/dist/math/quat/constants/schema.js.map +0 -1
- package/dist/math/quat/quat.d.ts +0 -4
- package/dist/math/quat/quat.js +0 -23
- package/dist/math/quat/quat.js.map +0 -1
- package/dist/math/transform/debug-inverse.js +0 -28
- package/dist/math/transform/debug-inverse.js.map +0 -1
- package/dist/math/transform/debug-quat.js +0 -23
- package/dist/math/transform/debug-quat.js.map +0 -1
- package/dist/math/transform/debug-test.js +0 -34
- package/dist/math/transform/debug-test.js.map +0 -1
- package/dist/math/transform/transform.d.ts +0 -58
- package/dist/math/transform/transform.js +0 -101
- package/dist/math/transform/transform.js.map +0 -1
- package/dist/math/transform/transform.test.js +0 -309
- package/dist/math/transform/transform.test.js.map +0 -1
- package/dist/math/u32/constants/index.d.ts +0 -1
- package/dist/math/u32/constants/index.js +0 -23
- package/dist/math/u32/constants/index.js.map +0 -1
- package/dist/math/u32/constants/schema.d.ts +0 -6
- package/dist/math/u32/constants/schema.js +0 -24
- package/dist/math/u32/constants/schema.js.map +0 -1
- package/dist/math/u32/u32.d.ts +0 -4
- package/dist/math/u32/u32.js +0 -23
- package/dist/math/u32/u32.js.map +0 -1
- package/dist/math/vec2/constants/functions.d.ts +0 -48
- package/dist/math/vec2/constants/functions.js +0 -104
- package/dist/math/vec2/constants/functions.js.map +0 -1
- package/dist/math/vec2/constants/index.d.ts +0 -3
- package/dist/math/vec2/constants/index.js +0 -25
- package/dist/math/vec2/constants/index.js.map +0 -1
- package/dist/math/vec2/constants/layout.d.ts +0 -1
- package/dist/math/vec2/constants/layout.js +0 -25
- package/dist/math/vec2/constants/layout.js.map +0 -1
- package/dist/math/vec2/constants/schema.d.ts +0 -11
- package/dist/math/vec2/constants/schema.js +0 -30
- package/dist/math/vec2/constants/schema.js.map +0 -1
- package/dist/math/vec2/functions/abs.d.ts +0 -2
- package/dist/math/vec2/functions/abs.js +0 -23
- package/dist/math/vec2/functions/abs.js.map +0 -1
- package/dist/math/vec2/functions/acos.d.ts +0 -2
- package/dist/math/vec2/functions/acos.js +0 -23
- package/dist/math/vec2/functions/acos.js.map +0 -1
- package/dist/math/vec2/functions/acosh.d.ts +0 -2
- package/dist/math/vec2/functions/acosh.js +0 -23
- package/dist/math/vec2/functions/acosh.js.map +0 -1
- package/dist/math/vec2/functions/add.d.ts +0 -2
- package/dist/math/vec2/functions/add.js +0 -23
- package/dist/math/vec2/functions/add.js.map +0 -1
- package/dist/math/vec2/functions/asin.d.ts +0 -2
- package/dist/math/vec2/functions/asin.js +0 -23
- package/dist/math/vec2/functions/asin.js.map +0 -1
- package/dist/math/vec2/functions/asinh.d.ts +0 -2
- package/dist/math/vec2/functions/asinh.js +0 -23
- package/dist/math/vec2/functions/asinh.js.map +0 -1
- package/dist/math/vec2/functions/atan.d.ts +0 -2
- package/dist/math/vec2/functions/atan.js +0 -23
- package/dist/math/vec2/functions/atan.js.map +0 -1
- package/dist/math/vec2/functions/atanh.d.ts +0 -2
- package/dist/math/vec2/functions/atanh.js +0 -23
- package/dist/math/vec2/functions/atanh.js.map +0 -1
- package/dist/math/vec2/functions/ceil.d.ts +0 -2
- package/dist/math/vec2/functions/ceil.js +0 -23
- package/dist/math/vec2/functions/ceil.js.map +0 -1
- package/dist/math/vec2/functions/clamp.d.ts +0 -2
- package/dist/math/vec2/functions/clamp.js +0 -25
- package/dist/math/vec2/functions/clamp.js.map +0 -1
- package/dist/math/vec2/functions/cos.d.ts +0 -2
- package/dist/math/vec2/functions/cos.js +0 -23
- package/dist/math/vec2/functions/cos.js.map +0 -1
- package/dist/math/vec2/functions/cosh.d.ts +0 -2
- package/dist/math/vec2/functions/cosh.js +0 -23
- package/dist/math/vec2/functions/cosh.js.map +0 -1
- package/dist/math/vec2/functions/distance.d.ts +0 -2
- package/dist/math/vec2/functions/distance.js +0 -25
- package/dist/math/vec2/functions/distance.js.map +0 -1
- package/dist/math/vec2/functions/dot.d.ts +0 -2
- package/dist/math/vec2/functions/dot.js +0 -23
- package/dist/math/vec2/functions/dot.js.map +0 -1
- package/dist/math/vec2/functions/exp-2.d.ts +0 -2
- package/dist/math/vec2/functions/exp-2.js +0 -23
- package/dist/math/vec2/functions/exp-2.js.map +0 -1
- package/dist/math/vec2/functions/exp.d.ts +0 -2
- package/dist/math/vec2/functions/exp.js +0 -23
- package/dist/math/vec2/functions/exp.js.map +0 -1
- package/dist/math/vec2/functions/face-forward.d.ts +0 -2
- package/dist/math/vec2/functions/face-forward.js +0 -25
- package/dist/math/vec2/functions/face-forward.js.map +0 -1
- package/dist/math/vec2/functions/floor.d.ts +0 -2
- package/dist/math/vec2/functions/floor.js +0 -23
- package/dist/math/vec2/functions/floor.js.map +0 -1
- package/dist/math/vec2/functions/fract.d.ts +0 -2
- package/dist/math/vec2/functions/fract.js +0 -23
- package/dist/math/vec2/functions/fract.js.map +0 -1
- package/dist/math/vec2/functions/functions.d.ts +0 -48
- package/dist/math/vec2/functions/functions.js +0 -104
- package/dist/math/vec2/functions/functions.js.map +0 -1
- package/dist/math/vec2/functions/index.d.ts +0 -3
- package/dist/math/vec2/functions/index.js +0 -25
- package/dist/math/vec2/functions/index.js.map +0 -1
- package/dist/math/vec2/functions/layout.d.ts +0 -1
- package/dist/math/vec2/functions/layout.js +0 -25
- package/dist/math/vec2/functions/layout.js.map +0 -1
- package/dist/math/vec2/functions/length.d.ts +0 -2
- package/dist/math/vec2/functions/length.js +0 -23
- package/dist/math/vec2/functions/length.js.map +0 -1
- package/dist/math/vec2/functions/log-2.d.ts +0 -2
- package/dist/math/vec2/functions/log-2.js +0 -23
- package/dist/math/vec2/functions/log-2.js.map +0 -1
- package/dist/math/vec2/functions/log.d.ts +0 -2
- package/dist/math/vec2/functions/log.js +0 -23
- package/dist/math/vec2/functions/log.js.map +0 -1
- package/dist/math/vec2/functions/max.d.ts +0 -2
- package/dist/math/vec2/functions/max.js +0 -23
- package/dist/math/vec2/functions/max.js.map +0 -1
- package/dist/math/vec2/functions/min.d.ts +0 -2
- package/dist/math/vec2/functions/min.js +0 -23
- package/dist/math/vec2/functions/min.js.map +0 -1
- package/dist/math/vec2/functions/mix.d.ts +0 -2
- package/dist/math/vec2/functions/mix.js +0 -26
- package/dist/math/vec2/functions/mix.js.map +0 -1
- package/dist/math/vec2/functions/mod.d.ts +0 -2
- package/dist/math/vec2/functions/mod.js +0 -26
- package/dist/math/vec2/functions/mod.js.map +0 -1
- package/dist/math/vec2/functions/modf.d.ts +0 -5
- package/dist/math/vec2/functions/modf.js +0 -26
- package/dist/math/vec2/functions/modf.js.map +0 -1
- package/dist/math/vec2/functions/negate.d.ts +0 -2
- package/dist/math/vec2/functions/negate.js +0 -23
- package/dist/math/vec2/functions/negate.js.map +0 -1
- package/dist/math/vec2/functions/normalize.d.ts +0 -2
- package/dist/math/vec2/functions/normalize.js +0 -28
- package/dist/math/vec2/functions/normalize.js.map +0 -1
- package/dist/math/vec2/functions/pow.d.ts +0 -2
- package/dist/math/vec2/functions/pow.js +0 -26
- package/dist/math/vec2/functions/pow.js.map +0 -1
- package/dist/math/vec2/functions/reflect.d.ts +0 -2
- package/dist/math/vec2/functions/reflect.js +0 -29
- package/dist/math/vec2/functions/reflect.js.map +0 -1
- package/dist/math/vec2/functions/refract.d.ts +0 -2
- package/dist/math/vec2/functions/refract.js +0 -34
- package/dist/math/vec2/functions/refract.js.map +0 -1
- package/dist/math/vec2/functions/round.d.ts +0 -2
- package/dist/math/vec2/functions/round.js +0 -23
- package/dist/math/vec2/functions/round.js.map +0 -1
- package/dist/math/vec2/functions/scale.d.ts +0 -2
- package/dist/math/vec2/functions/scale.js +0 -23
- package/dist/math/vec2/functions/scale.js.map +0 -1
- package/dist/math/vec2/functions/schema.d.ts +0 -11
- package/dist/math/vec2/functions/schema.js +0 -30
- package/dist/math/vec2/functions/schema.js.map +0 -1
- package/dist/math/vec2/functions/sign.d.ts +0 -2
- package/dist/math/vec2/functions/sign.js +0 -23
- package/dist/math/vec2/functions/sign.js.map +0 -1
- package/dist/math/vec2/functions/sin.d.ts +0 -2
- package/dist/math/vec2/functions/sin.js +0 -23
- package/dist/math/vec2/functions/sin.js.map +0 -1
- package/dist/math/vec2/functions/sinh.d.ts +0 -2
- package/dist/math/vec2/functions/sinh.js +0 -23
- package/dist/math/vec2/functions/sinh.js.map +0 -1
- package/dist/math/vec2/functions/smooth-step.d.ts +0 -2
- package/dist/math/vec2/functions/smooth-step.js +0 -27
- package/dist/math/vec2/functions/smooth-step.js.map +0 -1
- package/dist/math/vec2/functions/sqrt.d.ts +0 -2
- package/dist/math/vec2/functions/sqrt.js +0 -23
- package/dist/math/vec2/functions/sqrt.js.map +0 -1
- package/dist/math/vec2/functions/step.d.ts +0 -2
- package/dist/math/vec2/functions/step.js +0 -26
- package/dist/math/vec2/functions/step.js.map +0 -1
- package/dist/math/vec2/functions/subtract.d.ts +0 -2
- package/dist/math/vec2/functions/subtract.js +0 -23
- package/dist/math/vec2/functions/subtract.js.map +0 -1
- package/dist/math/vec2/functions/tan.d.ts +0 -2
- package/dist/math/vec2/functions/tan.js +0 -23
- package/dist/math/vec2/functions/tan.js.map +0 -1
- package/dist/math/vec2/functions/tanh.d.ts +0 -2
- package/dist/math/vec2/functions/tanh.js +0 -23
- package/dist/math/vec2/functions/tanh.js.map +0 -1
- package/dist/math/vec2/functions/trunc.d.ts +0 -2
- package/dist/math/vec2/functions/trunc.js +0 -23
- package/dist/math/vec2/functions/trunc.js.map +0 -1
- package/dist/math/vec2/vec2.d.ts +0 -4
- package/dist/math/vec2/vec2.js +0 -23
- package/dist/math/vec2/vec2.js.map +0 -1
- package/dist/math/vec3/constants/functions.d.ts +0 -59
- package/dist/math/vec3/constants/functions.js +0 -159
- package/dist/math/vec3/constants/functions.js.map +0 -1
- package/dist/math/vec3/constants/index.d.ts +0 -3
- package/dist/math/vec3/constants/index.js +0 -25
- package/dist/math/vec3/constants/index.js.map +0 -1
- package/dist/math/vec3/constants/layout.d.ts +0 -1
- package/dist/math/vec3/constants/layout.js +0 -25
- package/dist/math/vec3/constants/layout.js.map +0 -1
- package/dist/math/vec3/constants/schema.d.ts +0 -11
- package/dist/math/vec3/constants/schema.js +0 -30
- package/dist/math/vec3/constants/schema.js.map +0 -1
- package/dist/math/vec3/functions/abs.d.ts +0 -2
- package/dist/math/vec3/functions/abs.js +0 -23
- package/dist/math/vec3/functions/abs.js.map +0 -1
- package/dist/math/vec3/functions/acos.d.ts +0 -2
- package/dist/math/vec3/functions/acos.js +0 -23
- package/dist/math/vec3/functions/acos.js.map +0 -1
- package/dist/math/vec3/functions/acosh.d.ts +0 -2
- package/dist/math/vec3/functions/acosh.js +0 -23
- package/dist/math/vec3/functions/acosh.js.map +0 -1
- package/dist/math/vec3/functions/add.d.ts +0 -2
- package/dist/math/vec3/functions/add.js +0 -27
- package/dist/math/vec3/functions/add.js.map +0 -1
- package/dist/math/vec3/functions/asin.d.ts +0 -2
- package/dist/math/vec3/functions/asin.js +0 -23
- package/dist/math/vec3/functions/asin.js.map +0 -1
- package/dist/math/vec3/functions/asinh.d.ts +0 -2
- package/dist/math/vec3/functions/asinh.js +0 -23
- package/dist/math/vec3/functions/asinh.js.map +0 -1
- package/dist/math/vec3/functions/atan.d.ts +0 -2
- package/dist/math/vec3/functions/atan.js +0 -23
- package/dist/math/vec3/functions/atan.js.map +0 -1
- package/dist/math/vec3/functions/atanh.d.ts +0 -2
- package/dist/math/vec3/functions/atanh.js +0 -23
- package/dist/math/vec3/functions/atanh.js.map +0 -1
- package/dist/math/vec3/functions/ceil.d.ts +0 -2
- package/dist/math/vec3/functions/ceil.js +0 -23
- package/dist/math/vec3/functions/ceil.js.map +0 -1
- package/dist/math/vec3/functions/clamp.d.ts +0 -2
- package/dist/math/vec3/functions/clamp.js +0 -25
- package/dist/math/vec3/functions/clamp.js.map +0 -1
- package/dist/math/vec3/functions/cos.d.ts +0 -2
- package/dist/math/vec3/functions/cos.js +0 -23
- package/dist/math/vec3/functions/cos.js.map +0 -1
- package/dist/math/vec3/functions/cosh.d.ts +0 -2
- package/dist/math/vec3/functions/cosh.js +0 -23
- package/dist/math/vec3/functions/cosh.js.map +0 -1
- package/dist/math/vec3/functions/cross.d.ts +0 -2
- package/dist/math/vec3/functions/cross.js +0 -27
- package/dist/math/vec3/functions/cross.js.map +0 -1
- package/dist/math/vec3/functions/distance-squared.d.ts +0 -2
- package/dist/math/vec3/functions/distance-squared.js +0 -28
- package/dist/math/vec3/functions/distance-squared.js.map +0 -1
- package/dist/math/vec3/functions/distance.d.ts +0 -2
- package/dist/math/vec3/functions/distance.js +0 -25
- package/dist/math/vec3/functions/distance.js.map +0 -1
- package/dist/math/vec3/functions/dot.d.ts +0 -2
- package/dist/math/vec3/functions/dot.js +0 -23
- package/dist/math/vec3/functions/dot.js.map +0 -1
- package/dist/math/vec3/functions/equals.d.ts +0 -2
- package/dist/math/vec3/functions/equals.js +0 -23
- package/dist/math/vec3/functions/equals.js.map +0 -1
- package/dist/math/vec3/functions/exp-2.d.ts +0 -2
- package/dist/math/vec3/functions/exp-2.js +0 -23
- package/dist/math/vec3/functions/exp-2.js.map +0 -1
- package/dist/math/vec3/functions/exp.d.ts +0 -2
- package/dist/math/vec3/functions/exp.js +0 -23
- package/dist/math/vec3/functions/exp.js.map +0 -1
- package/dist/math/vec3/functions/face-forward.d.ts +0 -2
- package/dist/math/vec3/functions/face-forward.js +0 -25
- package/dist/math/vec3/functions/face-forward.js.map +0 -1
- package/dist/math/vec3/functions/floor.d.ts +0 -2
- package/dist/math/vec3/functions/floor.js +0 -23
- package/dist/math/vec3/functions/floor.js.map +0 -1
- package/dist/math/vec3/functions/fract.d.ts +0 -2
- package/dist/math/vec3/functions/fract.js +0 -27
- package/dist/math/vec3/functions/fract.js.map +0 -1
- package/dist/math/vec3/functions/index.d.ts +0 -54
- package/dist/math/vec3/functions/index.js +0 -76
- package/dist/math/vec3/functions/index.js.map +0 -1
- package/dist/math/vec3/functions/layout.d.ts +0 -1
- package/dist/math/vec3/functions/layout.js +0 -25
- package/dist/math/vec3/functions/layout.js.map +0 -1
- package/dist/math/vec3/functions/length-squared.d.ts +0 -2
- package/dist/math/vec3/functions/length-squared.js +0 -23
- package/dist/math/vec3/functions/length-squared.js.map +0 -1
- package/dist/math/vec3/functions/length.d.ts +0 -2
- package/dist/math/vec3/functions/length.js +0 -23
- package/dist/math/vec3/functions/length.js.map +0 -1
- package/dist/math/vec3/functions/log-2.d.ts +0 -2
- package/dist/math/vec3/functions/log-2.js +0 -23
- package/dist/math/vec3/functions/log-2.js.map +0 -1
- package/dist/math/vec3/functions/log.d.ts +0 -2
- package/dist/math/vec3/functions/log.js +0 -23
- package/dist/math/vec3/functions/log.js.map +0 -1
- package/dist/math/vec3/functions/max.d.ts +0 -2
- package/dist/math/vec3/functions/max.js +0 -27
- package/dist/math/vec3/functions/max.js.map +0 -1
- package/dist/math/vec3/functions/min.d.ts +0 -2
- package/dist/math/vec3/functions/min.js +0 -27
- package/dist/math/vec3/functions/min.js.map +0 -1
- package/dist/math/vec3/functions/mix.d.ts +0 -2
- package/dist/math/vec3/functions/mix.js +0 -27
- package/dist/math/vec3/functions/mix.js.map +0 -1
- package/dist/math/vec3/functions/mod.d.ts +0 -2
- package/dist/math/vec3/functions/mod.js +0 -27
- package/dist/math/vec3/functions/mod.js.map +0 -1
- package/dist/math/vec3/functions/modf.d.ts +0 -5
- package/dist/math/vec3/functions/modf.js +0 -26
- package/dist/math/vec3/functions/modf.js.map +0 -1
- package/dist/math/vec3/functions/multiply.d.ts +0 -5
- package/dist/math/vec3/functions/multiply.js +0 -30
- package/dist/math/vec3/functions/multiply.js.map +0 -1
- package/dist/math/vec3/functions/negate.d.ts +0 -2
- package/dist/math/vec3/functions/negate.js +0 -23
- package/dist/math/vec3/functions/negate.js.map +0 -1
- package/dist/math/vec3/functions/normalize.d.ts +0 -2
- package/dist/math/vec3/functions/normalize.js +0 -28
- package/dist/math/vec3/functions/normalize.js.map +0 -1
- package/dist/math/vec3/functions/one.d.ts +0 -2
- package/dist/math/vec3/functions/one.js +0 -23
- package/dist/math/vec3/functions/one.js.map +0 -1
- package/dist/math/vec3/functions/pow.d.ts +0 -2
- package/dist/math/vec3/functions/pow.js +0 -27
- package/dist/math/vec3/functions/pow.js.map +0 -1
- package/dist/math/vec3/functions/random.d.ts +0 -2
- package/dist/math/vec3/functions/random.js +0 -25
- package/dist/math/vec3/functions/random.js.map +0 -1
- package/dist/math/vec3/functions/reflect.d.ts +0 -2
- package/dist/math/vec3/functions/reflect.js +0 -29
- package/dist/math/vec3/functions/reflect.js.map +0 -1
- package/dist/math/vec3/functions/refract.d.ts +0 -2
- package/dist/math/vec3/functions/refract.js +0 -34
- package/dist/math/vec3/functions/refract.js.map +0 -1
- package/dist/math/vec3/functions/round.d.ts +0 -2
- package/dist/math/vec3/functions/round.js +0 -23
- package/dist/math/vec3/functions/round.js.map +0 -1
- package/dist/math/vec3/functions/scale.d.ts +0 -2
- package/dist/math/vec3/functions/scale.js +0 -23
- package/dist/math/vec3/functions/scale.js.map +0 -1
- package/dist/math/vec3/functions/schema.d.ts +0 -11
- package/dist/math/vec3/functions/schema.js +0 -30
- package/dist/math/vec3/functions/schema.js.map +0 -1
- package/dist/math/vec3/functions/sign.d.ts +0 -2
- package/dist/math/vec3/functions/sign.js +0 -23
- package/dist/math/vec3/functions/sign.js.map +0 -1
- package/dist/math/vec3/functions/sin.d.ts +0 -2
- package/dist/math/vec3/functions/sin.js +0 -23
- package/dist/math/vec3/functions/sin.js.map +0 -1
- package/dist/math/vec3/functions/sinh.d.ts +0 -2
- package/dist/math/vec3/functions/sinh.js +0 -23
- package/dist/math/vec3/functions/sinh.js.map +0 -1
- package/dist/math/vec3/functions/smooth-step.d.ts +0 -2
- package/dist/math/vec3/functions/smooth-step.js +0 -32
- package/dist/math/vec3/functions/smooth-step.js.map +0 -1
- package/dist/math/vec3/functions/sqrt.d.ts +0 -2
- package/dist/math/vec3/functions/sqrt.js +0 -23
- package/dist/math/vec3/functions/sqrt.js.map +0 -1
- package/dist/math/vec3/functions/step.d.ts +0 -2
- package/dist/math/vec3/functions/step.js +0 -27
- package/dist/math/vec3/functions/step.js.map +0 -1
- package/dist/math/vec3/functions/subtract.d.ts +0 -2
- package/dist/math/vec3/functions/subtract.js +0 -27
- package/dist/math/vec3/functions/subtract.js.map +0 -1
- package/dist/math/vec3/functions/tan.d.ts +0 -2
- package/dist/math/vec3/functions/tan.js +0 -23
- package/dist/math/vec3/functions/tan.js.map +0 -1
- package/dist/math/vec3/functions/tanh.d.ts +0 -2
- package/dist/math/vec3/functions/tanh.js +0 -23
- package/dist/math/vec3/functions/tanh.js.map +0 -1
- package/dist/math/vec3/functions/trunc.d.ts +0 -2
- package/dist/math/vec3/functions/trunc.js +0 -23
- package/dist/math/vec3/functions/trunc.js.map +0 -1
- package/dist/math/vec3/functions/zero.d.ts +0 -2
- package/dist/math/vec3/functions/zero.js +0 -23
- package/dist/math/vec3/functions/zero.js.map +0 -1
- package/dist/math/vec3/vec3.d.ts +0 -4
- package/dist/math/vec3/vec3.js +0 -23
- package/dist/math/vec3/vec3.js.map +0 -1
- package/dist/math/vec4/constants/functions.d.ts +0 -49
- package/dist/math/vec4/constants/functions.js +0 -150
- package/dist/math/vec4/constants/functions.js.map +0 -1
- package/dist/math/vec4/constants/index.d.ts +0 -3
- package/dist/math/vec4/constants/index.js +0 -25
- package/dist/math/vec4/constants/index.js.map +0 -1
- package/dist/math/vec4/constants/layout.d.ts +0 -1
- package/dist/math/vec4/constants/layout.js +0 -25
- package/dist/math/vec4/constants/layout.js.map +0 -1
- package/dist/math/vec4/constants/schema.d.ts +0 -11
- package/dist/math/vec4/constants/schema.js +0 -30
- package/dist/math/vec4/constants/schema.js.map +0 -1
- package/dist/math/vec4/functions/abs.d.ts +0 -2
- package/dist/math/vec4/functions/abs.js +0 -23
- package/dist/math/vec4/functions/abs.js.map +0 -1
- package/dist/math/vec4/functions/ceil.d.ts +0 -2
- package/dist/math/vec4/functions/ceil.js +0 -23
- package/dist/math/vec4/functions/ceil.js.map +0 -1
- package/dist/math/vec4/functions/clamp.d.ts +0 -2
- package/dist/math/vec4/functions/clamp.js +0 -25
- package/dist/math/vec4/functions/clamp.js.map +0 -1
- package/dist/math/vec4/functions/floor.d.ts +0 -2
- package/dist/math/vec4/functions/floor.js +0 -23
- package/dist/math/vec4/functions/floor.js.map +0 -1
- package/dist/math/vec4/functions/layout.d.ts +0 -1
- package/dist/math/vec4/functions/layout.js +0 -25
- package/dist/math/vec4/functions/layout.js.map +0 -1
- package/dist/math/vec4/functions/max.d.ts +0 -2
- package/dist/math/vec4/functions/max.js +0 -28
- package/dist/math/vec4/functions/max.js.map +0 -1
- package/dist/math/vec4/functions/min.d.ts +0 -2
- package/dist/math/vec4/functions/min.js +0 -28
- package/dist/math/vec4/functions/min.js.map +0 -1
- package/dist/math/vec4/functions/round.d.ts +0 -2
- package/dist/math/vec4/functions/round.js +0 -23
- package/dist/math/vec4/functions/round.js.map +0 -1
- package/dist/math/vec4/functions/schema.d.ts +0 -11
- package/dist/math/vec4/functions/schema.js +0 -30
- package/dist/math/vec4/functions/schema.js.map +0 -1
- package/dist/math/vec4/functions/trunc.d.ts +0 -2
- package/dist/math/vec4/functions/trunc.js +0 -23
- package/dist/math/vec4/functions/trunc.js.map +0 -1
- package/dist/math/vec4/vec4.d.ts +0 -4
- package/dist/math/vec4/vec4.js +0 -23
- package/dist/math/vec4/vec4.js.map +0 -1
- package/dist/observe/create-observable-event.d.ts +0 -10
- package/dist/observe/create-observable-event.js +0 -22
- package/dist/observe/create-observable-event.js.map +0 -1
- package/dist/observe/create-observable-state.d.ts +0 -7
- package/dist/observe/create-observable-state.js +0 -27
- package/dist/observe/create-observable-state.js.map +0 -1
- package/dist/observe/types.d.ts +0 -17
- package/dist/observe/types.js +0 -2
- package/dist/observe/types.js.map +0 -1
- package/dist/old-ecs/privacy/helper-functions.d.ts +0 -43
- package/dist/old-ecs/privacy/helper-functions.js +0 -76
- package/dist/old-ecs/privacy/helper-functions.js.map +0 -1
- package/dist/old-ecs/privacy/helper-functions.test.js +0 -173
- package/dist/old-ecs/privacy/helper-functions.test.js.map +0 -1
- package/dist/schema/boolean.d.ts +0 -3
- package/dist/schema/boolean.js +0 -25
- package/dist/schema/boolean.js.map +0 -1
- package/dist/schema/f32.d.ts +0 -6
- package/dist/schema/f32.js +0 -6
- package/dist/schema/f32.js.map +0 -1
- package/dist/schema/f64.d.ts +0 -6
- package/dist/schema/f64.js +0 -6
- package/dist/schema/f64.js.map +0 -1
- package/dist/schema/i32.d.ts +0 -7
- package/dist/schema/i32.js +0 -7
- package/dist/schema/i32.js.map +0 -1
- package/dist/schema/schema/index.d.ts +0 -2
- package/dist/schema/schema/index.js +0 -23
- package/dist/schema/schema/index.js.map +0 -1
- package/dist/schema/schema/nullable.d.ts +0 -6
- package/dist/schema/schema/nullable.js +0 -6
- package/dist/schema/schema/nullable.js.map +0 -1
- package/dist/schema/schema/public.d.ts +0 -3
- package/dist/schema/schema/public.js +0 -25
- package/dist/schema/schema/public.js.map +0 -1
- package/dist/schema/schema/to-vertex-buffer-layout.d.ts +0 -56
- package/dist/schema/schema/to-vertex-buffer-layout.js +0 -143
- package/dist/schema/schema/to-vertex-buffer-layout.js.map +0 -1
- package/dist/schema/schema/types.d.ts +0 -150
- package/dist/schema/schema/types.js +0 -34
- package/dist/schema/schema/types.js.map +0 -1
- package/dist/schema/time.d.ts +0 -7
- package/dist/schema/time.js +0 -24
- package/dist/schema/time.js.map +0 -1
- package/dist/schema/true.d.ts +0 -6
- package/dist/schema/true.js +0 -2
- package/dist/schema/true.js.map +0 -1
- package/dist/schema/u32.d.ts +0 -7
- package/dist/schema/u32.js +0 -7
- package/dist/schema/u32.js.map +0 -1
- package/dist/table/constants/functions.d.ts +0 -3
- package/dist/table/constants/functions.js +0 -34
- package/dist/table/constants/functions.js.map +0 -1
- package/dist/table/constants/index.d.ts +0 -1
- package/dist/table/constants/index.js +0 -23
- package/dist/table/constants/index.js.map +0 -1
- /package/dist/{ecs/database/create-database.test.d.ts → debug-type-test.d.ts} +0 -0
- /package/dist/ecs/database/{replicate.test.d.ts → calculate-system-order.test.d.ts} +0 -0
- /package/dist/ecs/database/{transactional-store/coalesce-transactions.test.d.ts → create-database-schema-test.d.ts} +0 -0
- /package/dist/ecs/database/{transactional-store/entity-id-preservation.test.d.ts → create-plugin-v2.test.d.ts} +0 -0
- /package/dist/ecs/{store/create-store.test.d.ts → database/create-plugin.test.d.ts} +0 -0
- /package/dist/ecs/{store/store-schema/create-store-schema-test.d.ts → database/database-with-systems.test.d.ts} +0 -0
- /package/dist/ecs/{store/store-schema/create-store-schema.d.ts → database/database.plugin.create.test.OLD.d.ts} +0 -0
- /package/dist/ecs/{store/store-schema/index.d.ts → database/database.plugin.create.test.d.ts} +0 -0
- /package/dist/ecs/{store/store-schema/store-schema.d.ts → database/database.plugin.test.d.ts} +0 -0
- /package/dist/ecs/{world/world-schema/create-world-schema-test.d.ts → database/database.test copy.d.ts} +0 -0
- /package/dist/{graphics/camera/screen-to-world-ray.test.d.ts → ecs/database/database.test.d.ts} +0 -0
- /package/dist/{graphics/camera/world-to-screen.test.d.ts → ecs/database/multi-param-inference-poc.test.d.ts} +0 -0
- /package/dist/{graphics/frame.d.ts → ecs/database/overload-inference-poc.test.d.ts} +0 -0
- /package/dist/{graphics/get-web-gpu-device-and-context.d.ts → ecs/database/public/create-database-from-schema.test.d.ts} +0 -0
- /package/dist/{graphics/graphics-context.d.ts → ecs/database/test-exactkeys.d.ts} +0 -0
- /package/dist/ecs/database/transactional-store/{coalesce-transactions.d.ts → coalesce-actions.d.ts} +0 -0
- /package/dist/{math/aabb-face/aabb-face.test.d.ts → ecs/database/transactional-store/coalesce-actions.test.d.ts} +0 -0
- /package/dist/{math/aabb-face/face.test.d.ts → ecs/database/type-inference-example.d.ts} +0 -0
- /package/dist/{math/aabb/functions.d.ts → ecs/database/type-inference-poc.test.d.ts} +0 -0
- /package/dist/{math/face/face.test.d.ts → ecs/plugins/scheduler/create-scheduler-plugin.test.d.ts} +0 -0
- /package/dist/{math/picking/face.d.ts → ecs/plugins/scheduler/type-inference-test.d.ts} +0 -0
- /package/dist/{math/transform/debug-inverse.d.ts → ecs/store/store.test.d.ts} +0 -0
- /package/dist/{math/transform/debug-quat.d.ts → ecs/system/system-factory/public/create.test.d.ts} +0 -0
- /package/dist/{math/transform/debug-test.d.ts → ecs/system/world-schema/public/create.test.d.ts} +0 -0
- /package/dist/{math/transform/transform.test.d.ts → ecs/world/calculate-system-order.test.d.ts} +0 -0
- /package/dist/{old-ecs/privacy/helper-functions.test.d.ts → ecs/world/create-world-schema-test.d.ts} +0 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest";
|
|
2
|
+
import { Database } from "../../database/database.js";
|
|
3
|
+
import { createSchedulerPlugin } from "./create-scheduler-plugin.js";
|
|
4
|
+
describe("createSchedulerPlugin", () => {
|
|
5
|
+
beforeEach(() => {
|
|
6
|
+
vi.useFakeTimers();
|
|
7
|
+
});
|
|
8
|
+
afterEach(() => {
|
|
9
|
+
vi.restoreAllMocks();
|
|
10
|
+
vi.useRealTimers();
|
|
11
|
+
});
|
|
12
|
+
it("should create scheduler plugin with timing resources", () => {
|
|
13
|
+
const plugin = createSchedulerPlugin();
|
|
14
|
+
expect(plugin.resources).toHaveProperty("scheduler");
|
|
15
|
+
expect(plugin.resources).toHaveProperty("deltaTime");
|
|
16
|
+
expect(plugin.resources).toHaveProperty("elapsedTime");
|
|
17
|
+
expect(plugin.resources).toHaveProperty("frame");
|
|
18
|
+
expect(plugin.systems).toHaveProperty("schedulerSystem");
|
|
19
|
+
});
|
|
20
|
+
it("should initialize with scheduler control interface", () => {
|
|
21
|
+
const plugin = createSchedulerPlugin();
|
|
22
|
+
const db = Database.create(plugin);
|
|
23
|
+
expect(db.resources.scheduler).toBeDefined();
|
|
24
|
+
expect(db.resources.scheduler.start).toBeInstanceOf(Function);
|
|
25
|
+
expect(db.resources.scheduler.stop).toBeInstanceOf(Function);
|
|
26
|
+
expect(db.resources.scheduler.pause).toBeInstanceOf(Function);
|
|
27
|
+
expect(db.resources.scheduler.resume).toBeInstanceOf(Function);
|
|
28
|
+
expect(db.resources.scheduler.step).toBeInstanceOf(Function);
|
|
29
|
+
expect(db.resources.scheduler.isRunning).toBe(false);
|
|
30
|
+
expect(db.resources.scheduler.isPaused).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
it("should auto-start when autoStart option is true", () => {
|
|
33
|
+
const plugin = createSchedulerPlugin({ autoStart: true });
|
|
34
|
+
const db = Database.create(plugin);
|
|
35
|
+
expect(db.resources.scheduler.isRunning).toBe(true);
|
|
36
|
+
expect(db.resources.scheduler.isPaused).toBe(false);
|
|
37
|
+
db.resources.scheduler.stop();
|
|
38
|
+
});
|
|
39
|
+
it("should start and stop scheduler", () => {
|
|
40
|
+
const plugin = createSchedulerPlugin();
|
|
41
|
+
const db = Database.create(plugin);
|
|
42
|
+
expect(db.resources.scheduler.isRunning).toBe(false);
|
|
43
|
+
db.resources.scheduler.start();
|
|
44
|
+
expect(db.resources.scheduler.isRunning).toBe(true);
|
|
45
|
+
db.resources.scheduler.stop();
|
|
46
|
+
expect(db.resources.scheduler.isRunning).toBe(false);
|
|
47
|
+
});
|
|
48
|
+
it("should pause and resume scheduler", () => {
|
|
49
|
+
const plugin = createSchedulerPlugin();
|
|
50
|
+
const db = Database.create(plugin);
|
|
51
|
+
db.resources.scheduler.start();
|
|
52
|
+
expect(db.resources.scheduler.isPaused).toBe(false);
|
|
53
|
+
db.resources.scheduler.pause();
|
|
54
|
+
expect(db.resources.scheduler.isPaused).toBe(true);
|
|
55
|
+
expect(db.resources.scheduler.isRunning).toBe(true);
|
|
56
|
+
db.resources.scheduler.resume();
|
|
57
|
+
expect(db.resources.scheduler.isPaused).toBe(false);
|
|
58
|
+
db.resources.scheduler.stop();
|
|
59
|
+
});
|
|
60
|
+
it("should execute systems in order", async () => {
|
|
61
|
+
const executionLog = [];
|
|
62
|
+
const gamePlugin = Database.Plugin.create({
|
|
63
|
+
components: {},
|
|
64
|
+
systems: {
|
|
65
|
+
system1: {
|
|
66
|
+
create: (_db) => () => {
|
|
67
|
+
executionLog.push("system1");
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
system2: {
|
|
71
|
+
create: (_db) => () => {
|
|
72
|
+
executionLog.push("system2");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
const db = Database.create(Database.Plugin.create({}, [gamePlugin, createSchedulerPlugin()]));
|
|
78
|
+
await db.resources.scheduler.step();
|
|
79
|
+
expect(executionLog).toContain("system1");
|
|
80
|
+
expect(executionLog).toContain("system2");
|
|
81
|
+
});
|
|
82
|
+
it("should update timing resources each frame", async () => {
|
|
83
|
+
const plugin = createSchedulerPlugin();
|
|
84
|
+
const db = Database.create(plugin);
|
|
85
|
+
expect(db.resources.deltaTime).toBe(0);
|
|
86
|
+
expect(db.resources.elapsedTime).toBe(0);
|
|
87
|
+
expect(db.resources.frame).toBe(0);
|
|
88
|
+
vi.setSystemTime(1000);
|
|
89
|
+
await db.resources.scheduler.step();
|
|
90
|
+
expect(db.resources.frame).toBe(0);
|
|
91
|
+
expect(db.resources.deltaTime).toBeGreaterThan(0);
|
|
92
|
+
expect(db.resources.elapsedTime).toBeGreaterThan(0);
|
|
93
|
+
vi.advanceTimersByTime(16);
|
|
94
|
+
await db.resources.scheduler.step();
|
|
95
|
+
expect(db.resources.frame).toBe(1);
|
|
96
|
+
});
|
|
97
|
+
it("should handle async systems", async () => {
|
|
98
|
+
const executionLog = [];
|
|
99
|
+
const gamePlugin = Database.Plugin.create({
|
|
100
|
+
components: {},
|
|
101
|
+
systems: {
|
|
102
|
+
asyncSystem: {
|
|
103
|
+
create: (_db) => async () => {
|
|
104
|
+
await Promise.resolve();
|
|
105
|
+
executionLog.push("async");
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
const db = Database.create(Database.Plugin.create({}, [gamePlugin, createSchedulerPlugin()]));
|
|
111
|
+
await db.resources.scheduler.step();
|
|
112
|
+
expect(executionLog).toContain("async");
|
|
113
|
+
});
|
|
114
|
+
it("should respect system scheduling order", async () => {
|
|
115
|
+
const executionLog = [];
|
|
116
|
+
const gamePlugin = Database.Plugin.create({
|
|
117
|
+
components: {},
|
|
118
|
+
systems: {
|
|
119
|
+
inputSystem: {
|
|
120
|
+
create: (_db) => () => {
|
|
121
|
+
executionLog.push("input");
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
physicsSystem: {
|
|
125
|
+
create: (_db) => () => {
|
|
126
|
+
executionLog.push("physics");
|
|
127
|
+
},
|
|
128
|
+
schedule: {
|
|
129
|
+
after: ["inputSystem"]
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
renderSystem: {
|
|
133
|
+
create: (_db) => () => {
|
|
134
|
+
executionLog.push("render");
|
|
135
|
+
},
|
|
136
|
+
schedule: {
|
|
137
|
+
after: ["physicsSystem"]
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
const db = Database.create(Database.Plugin.create({}, [gamePlugin, createSchedulerPlugin()]));
|
|
143
|
+
await db.resources.scheduler.step();
|
|
144
|
+
expect(executionLog).toEqual(["input", "physics", "render"]);
|
|
145
|
+
});
|
|
146
|
+
it("should filter out schedulerSystem from execution", async () => {
|
|
147
|
+
const executionLog = [];
|
|
148
|
+
const gamePlugin = Database.Plugin.create({
|
|
149
|
+
components: {},
|
|
150
|
+
systems: {
|
|
151
|
+
testSystem: {
|
|
152
|
+
create: (db) => () => {
|
|
153
|
+
// Log all systems being executed
|
|
154
|
+
for (const tier of db.system.order) {
|
|
155
|
+
executionLog.push(...tier);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
const plugin = createSchedulerPlugin();
|
|
162
|
+
const db = Database.create(Database.Plugin.create({}, [gamePlugin, plugin]));
|
|
163
|
+
await db.resources.scheduler.step();
|
|
164
|
+
// schedulerSystem should be in the order but not executed recursively
|
|
165
|
+
const allSystems = db.system.order.flat();
|
|
166
|
+
expect(allSystems).toContain("schedulerSystem");
|
|
167
|
+
});
|
|
168
|
+
it("should track frame count", async () => {
|
|
169
|
+
const plugin = createSchedulerPlugin();
|
|
170
|
+
const db = Database.create(plugin);
|
|
171
|
+
expect(db.resources.scheduler.frameCount).toBe(0);
|
|
172
|
+
await db.resources.scheduler.step();
|
|
173
|
+
expect(db.resources.scheduler.frameCount).toBe(1);
|
|
174
|
+
await db.resources.scheduler.step();
|
|
175
|
+
expect(db.resources.scheduler.frameCount).toBe(2);
|
|
176
|
+
});
|
|
177
|
+
it("should allow systems to access database", async () => {
|
|
178
|
+
let accessedDeltaTime = 0;
|
|
179
|
+
const gamePlugin = Database.Plugin.create({
|
|
180
|
+
components: {
|
|
181
|
+
position: { type: "object", default: { x: 0, y: 0 } }
|
|
182
|
+
},
|
|
183
|
+
systems: {
|
|
184
|
+
testSystem: {
|
|
185
|
+
create: (db) => () => {
|
|
186
|
+
accessedDeltaTime = db.resources.deltaTime;
|
|
187
|
+
const entities = db.select(["position"]);
|
|
188
|
+
expect(Array.isArray(entities)).toBe(true);
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
const db = Database.create(Database.Plugin.create({}, [gamePlugin, createSchedulerPlugin()]));
|
|
194
|
+
await db.resources.scheduler.step();
|
|
195
|
+
expect(accessedDeltaTime).toBeGreaterThanOrEqual(0);
|
|
196
|
+
});
|
|
197
|
+
});
|
|
198
|
+
//# sourceMappingURL=create-scheduler-plugin.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-scheduler-plugin.test.js","sourceRoot":"","sources":["../../../../src/ecs/plugins/scheduler/create-scheduler-plugin.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QA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,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;oBAC/C,CAAC;iBACJ;aACJ;SACJ,CAAC,CAAC;QAEH,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CACtB,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE,qBAAqB,EAAE,CAAC,CAAQ,CACpE,CAAC;QAET,MAAM,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC;QAEpC,MAAM,CAAC,iBAAiB,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./scheduler.js";
|
|
@@ -19,5 +19,5 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.*/
|
|
22
|
-
export * from "./
|
|
22
|
+
export * from "./scheduler.js";
|
|
23
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/ecs/plugins/scheduler/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
type SchedulerState = "running" | "paused" | "disposed";
|
|
2
|
+
export declare const scheduler: Required<import("../../index.js").Database.Plugin<import("../../component-schemas.js").ComponentSchemas, {
|
|
3
|
+
readonly schedulerState: {
|
|
4
|
+
readonly default: SchedulerState;
|
|
5
|
+
};
|
|
6
|
+
}, import("../../index.js").ArchetypeComponents<string>, import("../../index.js").ActionDeclarations<any, any, any>, "schedulerSystem">>;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*MIT License
|
|
2
|
+
|
|
3
|
+
© Copyright 2025 Adobe. All rights reserved.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.*/
|
|
22
|
+
import { createPlugin } from "../../database/create-plugin.js";
|
|
23
|
+
export const scheduler = createPlugin({
|
|
24
|
+
resources: {
|
|
25
|
+
schedulerState: { default: "running" }
|
|
26
|
+
},
|
|
27
|
+
systems: {
|
|
28
|
+
schedulerSystem: {
|
|
29
|
+
create: (db) => {
|
|
30
|
+
// Execute one frame
|
|
31
|
+
const executeFrame = async () => {
|
|
32
|
+
if (db.resources.schedulerState === "running") {
|
|
33
|
+
// Execute all systems in order (excluding schedulerSystem itself)
|
|
34
|
+
for (const tier of db.system.order) {
|
|
35
|
+
// Execute tier in parallel
|
|
36
|
+
await Promise.all(tier.map((name) => db.system.functions[name]()));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
if (db.resources.schedulerState !== "disposed") {
|
|
40
|
+
requestAnimationFrame(executeFrame);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
executeFrame();
|
|
44
|
+
// Return a no-op system function (the real work happens in the RAF loop)
|
|
45
|
+
return () => {
|
|
46
|
+
// No-op: The scheduler manages its own execution through RAF
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=scheduler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduler.js","sourceRoot":"","sources":["../../../../src/ecs/plugins/scheduler/scheduler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAEX,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAI/D,MAAM,CAAC,MAAM,SAAS,GAAG,YAAY,CAAC;IAClC,SAAS,EAAE;QACP,cAAc,EAAE,EAAE,OAAO,EAAE,SAA2B,EAAE;KAC3D;IACD,OAAO,EAAE;QACL,eAAe,EAAE;YACb,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE;gBACX,oBAAoB;gBACpB,MAAM,YAAY,GAAG,KAAK,IAAI,EAAE;oBAC5B,IAAI,EAAE,CAAC,SAAS,CAAC,cAAc,KAAK,SAAS,EAAE,CAAC;wBAC5C,kEAAkE;wBAClE,KAAK,MAAM,IAAI,IAAI,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;4BACjC,2BAA2B;4BAC3B,MAAM,OAAO,CAAC,GAAG,CACb,IAAI,CAAC,GAAG,CAAC,CAAC,IAAY,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAC1D,CAAC;wBACN,CAAC;oBACL,CAAC;oBAED,IAAI,EAAE,CAAC,SAAS,CAAC,cAAc,KAAK,UAAU,EAAE,CAAC;wBAC7C,qBAAqB,CAAC,YAAY,CAAC,CAAC;oBACxC,CAAC;gBACL,CAAC,CAAC;gBAEF,YAAY,EAAE,CAAC;gBAEf,yEAAyE;gBACzE,OAAO,GAAG,EAAE;oBACR,6DAA6D;gBACjE,CAAC,CAAC;YACN,CAAC;SACJ;KACJ;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-inference-test.js","sourceRoot":"","sources":["../../../../src/ecs/plugins/scheduler/type-inference-test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Store } from "./store.js";
|
|
2
|
+
import { Entity } from "../entity.js";
|
|
3
|
+
import { Components } from "./components.js";
|
|
4
|
+
import { ResourceComponents } from "./resource-components.js";
|
|
5
|
+
import { ArchetypeComponents } from "./archetype-components.js";
|
|
6
|
+
import { StringKeyof } from "../../types/types.js";
|
|
7
|
+
export type ActionDeclaration<C extends Components, R extends ResourceComponents, A extends ArchetypeComponents<StringKeyof<C>>, Input extends any | void = any> = (t: Store<C, R, A>, input: Input) => void | Entity;
|
|
8
|
+
export type AsyncArgsProvider<T> = () => Promise<T> | AsyncGenerator<T>;
|
|
9
|
+
export type ActionDeclarations<C extends Components, R extends ResourceComponents, A extends ArchetypeComponents<StringKeyof<C>>> = {
|
|
10
|
+
readonly [K: string]: ActionDeclaration<C, R, A>;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Converts from TransactionDeclarations to TransactionFunctions by removing the initial store argument.
|
|
14
|
+
*/
|
|
15
|
+
export type ToActionFunctions<T> = {
|
|
16
|
+
[K in keyof T]: T[K] extends (t: infer S) => infer R ? R extends void | Entity ? () => R : never : T[K] extends (t: infer S, input: infer Input) => infer R ? R extends void | Entity ? (arg: Input | AsyncArgsProvider<Input>) => R : never : never;
|
|
17
|
+
};
|
|
18
|
+
export type ActionFunction = (args?: any) => void | Entity;
|
|
19
|
+
export type ActionFunctions = {
|
|
20
|
+
readonly [K: string]: ActionFunction;
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-functions.js","sourceRoot":"","sources":["../../../src/ecs/store/action-functions.ts"],"names":[],"mappings":""}
|
|
@@ -21,13 +21,75 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
21
21
|
SOFTWARE.*/
|
|
22
22
|
import { Store } from "./store.js";
|
|
23
23
|
const storeSchema = Store.Schema.create({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
components: {
|
|
25
|
+
velocity: { type: "number" },
|
|
26
|
+
particle: { type: "boolean" },
|
|
27
|
+
},
|
|
28
|
+
resources: {
|
|
29
|
+
mousePosition: { type: "number", default: 0 },
|
|
30
|
+
fooPosition: { type: "number", default: 0 },
|
|
31
|
+
},
|
|
32
|
+
archetypes: {
|
|
33
|
+
Particle: ["particle"],
|
|
34
|
+
DynamicParticle: ["particle", "velocity"],
|
|
35
|
+
},
|
|
32
36
|
});
|
|
37
|
+
// Test store schema dependencies and merging
|
|
38
|
+
const aSchema = Store.Schema.create({
|
|
39
|
+
components: {
|
|
40
|
+
a: { type: "number" },
|
|
41
|
+
b: { type: "string" }
|
|
42
|
+
},
|
|
43
|
+
resources: {
|
|
44
|
+
c: { default: "string" }
|
|
45
|
+
},
|
|
46
|
+
archetypes: {
|
|
47
|
+
one: ["a", "b"]
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const bSchema = Store.Schema.create({
|
|
51
|
+
components: {
|
|
52
|
+
x: { type: "number" },
|
|
53
|
+
y: { type: "string" }
|
|
54
|
+
},
|
|
55
|
+
resources: {
|
|
56
|
+
z: { default: "string" }
|
|
57
|
+
},
|
|
58
|
+
archetypes: {
|
|
59
|
+
two: ["x", "y"]
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
const cSchema = Store.Schema.create({
|
|
63
|
+
components: {
|
|
64
|
+
m: { type: "number" },
|
|
65
|
+
n: { type: "string" }
|
|
66
|
+
},
|
|
67
|
+
resources: {
|
|
68
|
+
c: { default: "string" }
|
|
69
|
+
},
|
|
70
|
+
archetypes: {
|
|
71
|
+
three: ["m", "n", "m", "x"]
|
|
72
|
+
},
|
|
73
|
+
}, [aSchema, bSchema]);
|
|
74
|
+
// Runtime checks: verify the merged schema contains all properties
|
|
75
|
+
const hasAllComponents = "a" in cSchema.components &&
|
|
76
|
+
"b" in cSchema.components &&
|
|
77
|
+
"x" in cSchema.components &&
|
|
78
|
+
"y" in cSchema.components &&
|
|
79
|
+
"m" in cSchema.components &&
|
|
80
|
+
"n" in cSchema.components;
|
|
81
|
+
const hasAllResources = "c" in cSchema.resources &&
|
|
82
|
+
"z" in cSchema.resources;
|
|
83
|
+
const hasAllArchetypes = "one" in cSchema.archetypes &&
|
|
84
|
+
"two" in cSchema.archetypes &&
|
|
85
|
+
"three" in cSchema.archetypes;
|
|
86
|
+
if (!hasAllComponents) {
|
|
87
|
+
throw new Error("Schema merging failed: missing components");
|
|
88
|
+
}
|
|
89
|
+
if (!hasAllResources) {
|
|
90
|
+
throw new Error("Schema merging failed: missing resources");
|
|
91
|
+
}
|
|
92
|
+
if (!hasAllArchetypes) {
|
|
93
|
+
throw new Error("Schema merging failed: missing archetypes");
|
|
94
|
+
}
|
|
33
95
|
//# sourceMappingURL=create-store-schema-test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-store-schema-test.js","sourceRoot":"","sources":["../../../src/ecs/store/create-store-schema-test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;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ACjE,CAAC;AAED,IAAI,CAAC,eAAe,EAAE,CAAC;IACnB,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;AAChE,CAAC;AAED,IAAI,CAAC,gBAAgB,EAAE,CAAC;IACpB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Entity } from "../entity.js";
|
|
2
|
+
/**
|
|
3
|
+
* EntityFunctions are ecs functions that usually modify the store or database and may return a single entity id or void.
|
|
4
|
+
*/
|
|
5
|
+
export type EntityFunctions = {
|
|
6
|
+
readonly [K: string]: (...args: any[]) => Entity | void;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-functions.js","sourceRoot":"","sources":["../../../src/ecs/store/entity-functions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"functions.js","sourceRoot":"","sources":["../../../src/ecs/store/functions.ts"],"names":[],"mappings":""}
|
|
@@ -28,13 +28,13 @@ export function createStore(schema) {
|
|
|
28
28
|
"components" in schemaArg &&
|
|
29
29
|
"resources" in schemaArg &&
|
|
30
30
|
"archetypes" in schemaArg;
|
|
31
|
-
const normalizedSchema =
|
|
31
|
+
const normalizedSchema = hasSchemaShape
|
|
32
32
|
? schemaArg
|
|
33
33
|
: {
|
|
34
|
-
components:
|
|
35
|
-
resources:
|
|
36
|
-
archetypes:
|
|
37
|
-
}
|
|
34
|
+
components: {},
|
|
35
|
+
resources: {},
|
|
36
|
+
archetypes: {},
|
|
37
|
+
};
|
|
38
38
|
const resources = {};
|
|
39
39
|
const componentSchemas = {};
|
|
40
40
|
const resourceSchemas = {};
|
|
@@ -66,8 +66,9 @@ export function createStore(schema) {
|
|
|
66
66
|
};
|
|
67
67
|
const archetypes = {};
|
|
68
68
|
const extend = (schema) => {
|
|
69
|
+
const { components: schemaComponents = {}, resources: schemaResources = {}, archetypes: schemaArchetypes = {} } = schema;
|
|
69
70
|
// components: existing must be identical if present
|
|
70
|
-
for (const [name, newComponentSchema] of Object.entries(
|
|
71
|
+
for (const [name, newComponentSchema] of Object.entries(schemaComponents)) {
|
|
71
72
|
if (name in componentAndResourceSchemas) {
|
|
72
73
|
if (componentAndResourceSchemas[name] !== newComponentSchema) {
|
|
73
74
|
throw new Error(`Component schema for "${name}" must be identical when extending.`);
|
|
@@ -80,7 +81,7 @@ export function createStore(schema) {
|
|
|
80
81
|
}
|
|
81
82
|
// resources: existing must be identical if present
|
|
82
83
|
const newResourceNames = [];
|
|
83
|
-
for (const [name, newResourceSchema] of Object.entries(
|
|
84
|
+
for (const [name, newResourceSchema] of Object.entries(schemaResources)) {
|
|
84
85
|
if (name in resourceSchemas) {
|
|
85
86
|
if (resourceSchemas[name] !== newResourceSchema) {
|
|
86
87
|
throw new Error(`Resource schema for "${name}" must be identical when extending.`);
|
|
@@ -94,7 +95,7 @@ export function createStore(schema) {
|
|
|
94
95
|
ensureResourceInitialized(name, newResourceSchema);
|
|
95
96
|
}
|
|
96
97
|
// archetypes: existing must be identical if present
|
|
97
|
-
for (const [name, newComponents] of Object.entries(
|
|
98
|
+
for (const [name, newComponents] of Object.entries(schemaArchetypes)) {
|
|
98
99
|
if (name in archetypeComponentNames) {
|
|
99
100
|
if (archetypeComponentNames[name] !== newComponents) {
|
|
100
101
|
throw new Error(`Archetype definition for "${name}" must be identical when extending.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-store.js","sourceRoot":"","sources":["../../../../src/ecs/store/public/create-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;WAoBW;AAQX,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAMpD,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAG5D,MAAM,UAAU,WAAW,CAKvB,MAAgC;IAEhC,MAAM,SAAS,GAAG,MAAa,CAAC;IAChC,MA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,KAAK,aAAa,EAAE,CAAC;oBAC1F,MAAM,IAAI,KAAK,CAAC,6BAA6B,IAAI,qCAAqC,CAAC,CAAC;gBAC5F,CAAC;gBACD,SAAS;YACb,CAAC;YACD,uBAAuB,CAAC,IAA4C,CAAC,GAAG,aAAoB,CAAC;YAC7F,MAAM,SAAS,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE,GAAI,aAAqB,CAAC,CAAC,CAAC;YACzE,UAAkB,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;QAC1C,CAAC;QAED,OAAO,KAAY,CAAC;IACxB,CAAC,CAAA;IAED,MAAM,KAAK,GAAgB;QACvB,GAAG,IAAI;QACP,SAAS;QACT,MAAM;QACN,UAAU;QACV,MAAM;QACN,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE;QAC3B,QAAQ,EAAE,CAAC,IAAa,EAAE,EAAE;YACxB,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;YACpB,KAAK,MAAM,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;gBACnE,yBAAyB,CAAC,IAAI,EAAE,cAAqB,CAAC,CAAC;YAC3D,CAAC;QACL,CAAC;KACJ,CAAC;IAEF,OAAO,KAAK,CAAC,MAAM,CAAC,gBAAgB,CAAQ,CAAC;AACjD,CAAC"}
|
|
@@ -721,5 +721,10 @@ describe("createStore", () => {
|
|
|
721
721
|
expect(Object.keys(newStore.resources)).toHaveLength(0);
|
|
722
722
|
});
|
|
723
723
|
});
|
|
724
|
+
it("should return the same instance when extended", () => {
|
|
725
|
+
const store = createStore({ components: { position: positionSchema }, resources: {}, archetypes: {} });
|
|
726
|
+
const extended = store.extend({ components: {}, resources: {}, archetypes: {} });
|
|
727
|
+
expect(extended).toBe(store);
|
|
728
|
+
});
|
|
724
729
|
});
|
|
725
730
|
//# sourceMappingURL=create-store.test.js.map
|