@adobe/data 0.9.0 → 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 +10 -0
- package/dist/ecs/database/calculate-system-order.js +152 -26
- package/dist/ecs/database/calculate-system-order.js.map +1 -1
- package/dist/ecs/database/calculate-system-order.test.js +228 -0
- package/dist/ecs/database/calculate-system-order.test.js.map +1 -1
- 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 +2 -0
- package/dist/ecs/database/create-plugin.js.map +1 -1
- package/dist/ecs/database/create-plugin.test.js +2 -0
- package/dist/ecs/database/create-plugin.test.js.map +1 -1
- 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 +7 -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/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/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.d.ts +1 -0
- 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.test.js +3 -3
- package/dist/ecs/database/transactional-store/coalesce-transactions.test.js.map +1 -1
- 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-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/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/scheduler.d.ts +2 -3
- package/dist/ecs/plugins/scheduler/scheduler.js +2 -2
- package/dist/ecs/plugins/scheduler/scheduler.js.map +1 -1
- 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/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/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/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.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.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.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.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.js +176 -0
- package/dist/ecs/world/world.test.js.map +1 -0
- 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/state-service/create-todo-database.d.ts +2 -2
- package/dist/samples/todo/services/state-service/create-todo-store.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +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.d.ts +0 -16
- package/dist/ecs/database/transactional-store/coalesce-transactions.js +0 -140
- 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 +0 -23
- 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 +0 -23
- 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.d.ts +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.d.ts +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 → create-database-schema-test.d.ts} +0 -0
- /package/dist/ecs/database/{transactional-store/coalesce-transactions.test.d.ts → create-plugin-v2.test.d.ts} +0 -0
- /package/dist/ecs/database/{transactional-store/entity-id-preservation.test.d.ts → database-with-systems.test.d.ts} +0 -0
- /package/dist/ecs/{store/create-store.test.d.ts → database/database.plugin.create.test.OLD.d.ts} +0 -0
- /package/dist/ecs/{store/store-schema/create-store-schema-test.d.ts → database/database.plugin.create.test.d.ts} +0 -0
- /package/dist/ecs/{store/store-schema/create-store-schema.d.ts → database/database.plugin.test.d.ts} +0 -0
- /package/dist/ecs/{store/store-schema/index.d.ts → database/database.test copy.d.ts} +0 -0
- /package/dist/ecs/{store/store-schema/store-schema.d.ts → database/multi-param-inference-poc.test.d.ts} +0 -0
- /package/dist/ecs/{world/world-schema/create-world-schema-test.d.ts → database/overload-inference-poc.test.d.ts} +0 -0
- /package/dist/{graphics/camera/screen-to-world-ray.test.d.ts → ecs/database/test-exactkeys.d.ts} +0 -0
- /package/dist/{graphics/camera/world-to-screen.test.d.ts → ecs/database/type-inference-poc.test.d.ts} +0 -0
- /package/dist/{graphics/frame.d.ts → ecs/plugins/scheduler/create-scheduler-plugin.test.d.ts} +0 -0
- /package/dist/{graphics/get-web-gpu-device-and-context.d.ts → ecs/plugins/scheduler/type-inference-test.d.ts} +0 -0
- /package/dist/{graphics/graphics-context.d.ts → ecs/system/system-factory/public/create.test.d.ts} +0 -0
- /package/dist/{math/aabb-face/aabb-face.test.d.ts → ecs/system/world-schema/public/create.test.d.ts} +0 -0
- /package/dist/{math/aabb-face/face.test.d.ts → ecs/world/calculate-system-order.test.d.ts} +0 -0
- /package/dist/{math/aabb/functions.d.ts → ecs/world/create-world-schema-test.d.ts} +0 -0
- /package/dist/{math/face/face.test.d.ts → ecs/world/create-world-type-test.d.ts} +0 -0
- /package/dist/{math/picking/face.d.ts → ecs/world/public/world-schema/public/create.test.d.ts} +0 -0
- /package/dist/{math/transform/debug-inverse.d.ts → ecs/world/system-schedule-typing-test.d.ts} +0 -0
- /package/dist/{math/transform/debug-quat.d.ts → ecs/world/world-schema/public/create.test.d.ts} +0 -0
- /package/dist/{math/transform/debug-test.d.ts → ecs/world/world.test.d.ts} +0 -0
|
@@ -1,725 +0,0 @@
|
|
|
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 { describe, it, expect } from "vitest";
|
|
23
|
-
import { createStore } from "./create-store.js";
|
|
24
|
-
import { createCoreTestSuite, positionSchema, healthSchema, nameSchema } from "./core/create-core.test.js";
|
|
25
|
-
import { F32 } from "../../math/f32/index.js";
|
|
26
|
-
import { Time } from "../../schema/index.js";
|
|
27
|
-
describe("createStore", () => {
|
|
28
|
-
// Test that store passes all core functionality tests
|
|
29
|
-
createCoreTestSuite("Store core functionality", (componentSchemas) => createStore({ components: componentSchemas, resources: {}, archetypes: {} }));
|
|
30
|
-
// Select function tests
|
|
31
|
-
describe("Select functionality", () => {
|
|
32
|
-
const velocitySchema = {
|
|
33
|
-
type: "object",
|
|
34
|
-
properties: {
|
|
35
|
-
x: F32.schema,
|
|
36
|
-
y: F32.schema,
|
|
37
|
-
z: F32.schema,
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
it("should select entities from single archetype", () => {
|
|
41
|
-
const store = createStore({ components: {
|
|
42
|
-
position: positionSchema,
|
|
43
|
-
health: healthSchema,
|
|
44
|
-
name: nameSchema,
|
|
45
|
-
}, resources: {}, archetypes: {} });
|
|
46
|
-
// Create entities in a single archetype
|
|
47
|
-
const archetype = store.ensureArchetype(["id", "position", "health"]);
|
|
48
|
-
const entity1 = archetype.insert({
|
|
49
|
-
position: { x: 1, y: 2, z: 3 },
|
|
50
|
-
health: { current: 100, max: 100 }
|
|
51
|
-
});
|
|
52
|
-
const entity2 = archetype.insert({
|
|
53
|
-
position: { x: 4, y: 5, z: 6 },
|
|
54
|
-
health: { current: 50, max: 100 }
|
|
55
|
-
});
|
|
56
|
-
// Select entities with position and health
|
|
57
|
-
const entities = store.select(["position", "health"]);
|
|
58
|
-
expect(entities).toHaveLength(2);
|
|
59
|
-
expect(entities).toContain(entity1);
|
|
60
|
-
expect(entities).toContain(entity2);
|
|
61
|
-
});
|
|
62
|
-
it("should select entities spanning multiple archetypes", () => {
|
|
63
|
-
const store = createStore({ components: {
|
|
64
|
-
position: positionSchema,
|
|
65
|
-
health: healthSchema,
|
|
66
|
-
name: nameSchema,
|
|
67
|
-
velocity: velocitySchema,
|
|
68
|
-
}, resources: {}, archetypes: {} });
|
|
69
|
-
// Create entities in different archetypes
|
|
70
|
-
const positionOnlyArchetype = store.ensureArchetype(["id", "position"]);
|
|
71
|
-
const entity1 = positionOnlyArchetype.insert({
|
|
72
|
-
position: { x: 1, y: 2, z: 3 }
|
|
73
|
-
});
|
|
74
|
-
const entity2 = positionOnlyArchetype.insert({
|
|
75
|
-
position: { x: 4, y: 5, z: 6 }
|
|
76
|
-
});
|
|
77
|
-
const healthOnlyArchetype = store.ensureArchetype(["id", "health"]);
|
|
78
|
-
const entity3 = healthOnlyArchetype.insert({
|
|
79
|
-
health: { current: 100, max: 100 }
|
|
80
|
-
});
|
|
81
|
-
const positionHealthArchetype = store.ensureArchetype(["id", "position", "health"]);
|
|
82
|
-
const entity4 = positionHealthArchetype.insert({
|
|
83
|
-
position: { x: 0, y: 0, z: 0 },
|
|
84
|
-
health: { current: 50, max: 100 }
|
|
85
|
-
});
|
|
86
|
-
const velocityArchetype = store.ensureArchetype(["id", "velocity"]);
|
|
87
|
-
const entity5 = velocityArchetype.insert({
|
|
88
|
-
velocity: { x: 1, y: 0, z: 0 }
|
|
89
|
-
});
|
|
90
|
-
// Select all entities with position component (should span 2 archetypes)
|
|
91
|
-
const positionEntities = store.select(["position"]);
|
|
92
|
-
expect(positionEntities).toHaveLength(3);
|
|
93
|
-
expect(positionEntities).toContain(entity1);
|
|
94
|
-
expect(positionEntities).toContain(entity2);
|
|
95
|
-
expect(positionEntities).toContain(entity4);
|
|
96
|
-
expect(positionEntities).not.toContain(entity3);
|
|
97
|
-
expect(positionEntities).not.toContain(entity5);
|
|
98
|
-
// Select all entities with health component (should span 2 archetypes)
|
|
99
|
-
const healthEntities = store.select(["health"]);
|
|
100
|
-
expect(healthEntities).toHaveLength(2);
|
|
101
|
-
expect(healthEntities).toContain(entity3);
|
|
102
|
-
expect(healthEntities).toContain(entity4);
|
|
103
|
-
expect(healthEntities).not.toContain(entity1);
|
|
104
|
-
expect(healthEntities).not.toContain(entity2);
|
|
105
|
-
expect(healthEntities).not.toContain(entity5);
|
|
106
|
-
// Select entities with both position and health (should be only 1 archetype)
|
|
107
|
-
const bothEntities = store.select(["position", "health"]);
|
|
108
|
-
expect(bothEntities).toHaveLength(1);
|
|
109
|
-
expect(bothEntities).toContain(entity4);
|
|
110
|
-
expect(bothEntities).not.toContain(entity1);
|
|
111
|
-
expect(bothEntities).not.toContain(entity2);
|
|
112
|
-
expect(bothEntities).not.toContain(entity3);
|
|
113
|
-
expect(bothEntities).not.toContain(entity5);
|
|
114
|
-
});
|
|
115
|
-
it("should select entities with exclude option", () => {
|
|
116
|
-
const store = createStore({ components: {
|
|
117
|
-
position: positionSchema,
|
|
118
|
-
health: healthSchema,
|
|
119
|
-
name: nameSchema,
|
|
120
|
-
}, resources: {}, archetypes: {} });
|
|
121
|
-
// Create entities in different archetypes
|
|
122
|
-
const positionOnlyArchetype = store.ensureArchetype(["id", "position"]);
|
|
123
|
-
const entity1 = positionOnlyArchetype.insert({
|
|
124
|
-
position: { x: 1, y: 2, z: 3 }
|
|
125
|
-
});
|
|
126
|
-
const positionHealthArchetype = store.ensureArchetype(["id", "position", "health"]);
|
|
127
|
-
const entity2 = positionHealthArchetype.insert({
|
|
128
|
-
position: { x: 0, y: 0, z: 0 },
|
|
129
|
-
health: { current: 50, max: 100 }
|
|
130
|
-
});
|
|
131
|
-
// Select entities with position but exclude health
|
|
132
|
-
const positionOnlyEntities = store.select(["position"], { exclude: ["health"] });
|
|
133
|
-
expect(positionOnlyEntities).toHaveLength(1);
|
|
134
|
-
expect(positionOnlyEntities).toContain(entity1);
|
|
135
|
-
expect(positionOnlyEntities).not.toContain(entity2);
|
|
136
|
-
});
|
|
137
|
-
it("should return empty array when no entities match", () => {
|
|
138
|
-
const store = createStore({ components: {
|
|
139
|
-
position: positionSchema,
|
|
140
|
-
health: healthSchema,
|
|
141
|
-
}, resources: {}, archetypes: {} });
|
|
142
|
-
// Create entity with only position
|
|
143
|
-
const archetype = store.ensureArchetype(["id", "position"]);
|
|
144
|
-
archetype.insert({ position: { x: 1, y: 2, z: 3 } });
|
|
145
|
-
// Select entities with health (should be empty)
|
|
146
|
-
const entities = store.select(["health"]);
|
|
147
|
-
expect(entities).toHaveLength(0);
|
|
148
|
-
});
|
|
149
|
-
it("should handle complex multi-archetype scenarios", () => {
|
|
150
|
-
const store = createStore({ components: {
|
|
151
|
-
position: positionSchema,
|
|
152
|
-
health: healthSchema,
|
|
153
|
-
name: nameSchema,
|
|
154
|
-
velocity: velocitySchema,
|
|
155
|
-
}, resources: {}, archetypes: {} });
|
|
156
|
-
// Create entities across many different archetypes
|
|
157
|
-
const archetype1 = store.ensureArchetype(["id", "position"]);
|
|
158
|
-
const entity1 = archetype1.insert({ position: { x: 1, y: 2, z: 3 } });
|
|
159
|
-
const entity2 = archetype1.insert({ position: { x: 4, y: 5, z: 6 } });
|
|
160
|
-
const archetype2 = store.ensureArchetype(["id", "health"]);
|
|
161
|
-
const entity3 = archetype2.insert({ health: { current: 100, max: 100 } });
|
|
162
|
-
const archetype3 = store.ensureArchetype(["id", "position", "health"]);
|
|
163
|
-
const entity4 = archetype3.insert({
|
|
164
|
-
position: { x: 0, y: 0, z: 0 },
|
|
165
|
-
health: { current: 50, max: 100 }
|
|
166
|
-
});
|
|
167
|
-
const entity5 = archetype3.insert({
|
|
168
|
-
position: { x: 10, y: 20, z: 30 },
|
|
169
|
-
health: { current: 75, max: 100 }
|
|
170
|
-
});
|
|
171
|
-
const archetype4 = store.ensureArchetype(["id", "name"]);
|
|
172
|
-
const entity6 = archetype4.insert({ name: "Player1" });
|
|
173
|
-
const archetype5 = store.ensureArchetype(["id", "position", "name"]);
|
|
174
|
-
const entity7 = archetype5.insert({
|
|
175
|
-
position: { x: 100, y: 200, z: 300 },
|
|
176
|
-
name: "Player2"
|
|
177
|
-
});
|
|
178
|
-
const archetype6 = store.ensureArchetype(["id", "position", "health", "name"]);
|
|
179
|
-
const entity8 = archetype6.insert({
|
|
180
|
-
position: { x: 500, y: 600, z: 700 },
|
|
181
|
-
health: { current: 25, max: 100 },
|
|
182
|
-
name: "Player3"
|
|
183
|
-
});
|
|
184
|
-
// Test various selection scenarios
|
|
185
|
-
const positionEntities = store.select(["position"]);
|
|
186
|
-
expect(positionEntities).toHaveLength(6);
|
|
187
|
-
expect(positionEntities).toContain(entity1);
|
|
188
|
-
expect(positionEntities).toContain(entity2);
|
|
189
|
-
expect(positionEntities).toContain(entity4);
|
|
190
|
-
expect(positionEntities).toContain(entity5);
|
|
191
|
-
expect(positionEntities).toContain(entity7);
|
|
192
|
-
expect(positionEntities).toContain(entity8);
|
|
193
|
-
const nameEntities = store.select(["name"]);
|
|
194
|
-
expect(nameEntities).toHaveLength(3);
|
|
195
|
-
expect(nameEntities).toContain(entity6);
|
|
196
|
-
expect(nameEntities).toContain(entity7);
|
|
197
|
-
expect(nameEntities).toContain(entity8);
|
|
198
|
-
const positionNameEntities = store.select(["position", "name"]);
|
|
199
|
-
expect(positionNameEntities).toHaveLength(2);
|
|
200
|
-
expect(positionNameEntities).toContain(entity7);
|
|
201
|
-
expect(positionNameEntities).toContain(entity8);
|
|
202
|
-
const allThreeEntities = store.select(["position", "health", "name"]);
|
|
203
|
-
expect(allThreeEntities).toHaveLength(1);
|
|
204
|
-
expect(allThreeEntities).toContain(entity8);
|
|
205
|
-
// Test exclusion
|
|
206
|
-
const positionWithoutHealth = store.select(["position"], { exclude: ["health"] });
|
|
207
|
-
expect(positionWithoutHealth).toHaveLength(3);
|
|
208
|
-
expect(positionWithoutHealth).toContain(entity1);
|
|
209
|
-
expect(positionWithoutHealth).toContain(entity2);
|
|
210
|
-
expect(positionWithoutHealth).toContain(entity7);
|
|
211
|
-
expect(positionWithoutHealth).not.toContain(entity4);
|
|
212
|
-
expect(positionWithoutHealth).not.toContain(entity5);
|
|
213
|
-
expect(positionWithoutHealth).not.toContain(entity8);
|
|
214
|
-
});
|
|
215
|
-
it("should maintain entity order across archetypes", () => {
|
|
216
|
-
const store = createStore({ components: {
|
|
217
|
-
position: positionSchema,
|
|
218
|
-
health: healthSchema,
|
|
219
|
-
}, resources: {}, archetypes: {} });
|
|
220
|
-
// Create entities in different archetypes
|
|
221
|
-
const archetype1 = store.ensureArchetype(["id", "position"]);
|
|
222
|
-
const entity1 = archetype1.insert({ position: { x: 1, y: 2, z: 3 } });
|
|
223
|
-
const entity2 = archetype1.insert({ position: { x: 4, y: 5, z: 6 } });
|
|
224
|
-
const archetype2 = store.ensureArchetype(["id", "health"]);
|
|
225
|
-
const entity3 = archetype2.insert({ health: { current: 100, max: 100 } });
|
|
226
|
-
const archetype3 = store.ensureArchetype(["id", "position", "health"]);
|
|
227
|
-
const entity4 = archetype3.insert({
|
|
228
|
-
position: { x: 0, y: 0, z: 0 },
|
|
229
|
-
health: { current: 50, max: 100 }
|
|
230
|
-
});
|
|
231
|
-
// Select all entities with position
|
|
232
|
-
const entities = store.select(["position"]);
|
|
233
|
-
expect(entities).toHaveLength(3);
|
|
234
|
-
// Verify all expected entities are present (order may vary)
|
|
235
|
-
expect(entities).toContain(entity1);
|
|
236
|
-
expect(entities).toContain(entity2);
|
|
237
|
-
expect(entities).toContain(entity4);
|
|
238
|
-
expect(entities).not.toContain(entity3);
|
|
239
|
-
});
|
|
240
|
-
it("should handle empty store", () => {
|
|
241
|
-
const store = createStore({ components: {
|
|
242
|
-
position: positionSchema,
|
|
243
|
-
health: healthSchema,
|
|
244
|
-
}, resources: {}, archetypes: {} });
|
|
245
|
-
const entities = store.select(["position"]);
|
|
246
|
-
expect(entities).toHaveLength(0);
|
|
247
|
-
});
|
|
248
|
-
it("should work with resources as components", () => {
|
|
249
|
-
const store = createStore({ components: {
|
|
250
|
-
position: positionSchema,
|
|
251
|
-
health: healthSchema,
|
|
252
|
-
}, resources: {
|
|
253
|
-
time: { default: { delta: 0.016, elapsed: 0 } }
|
|
254
|
-
}, archetypes: {} });
|
|
255
|
-
// Create some entities
|
|
256
|
-
const archetype = store.ensureArchetype(["id", "position"]);
|
|
257
|
-
const entity = archetype.insert({ position: { x: 1, y: 2, z: 3 } });
|
|
258
|
-
// Select entities with time component (should include the resource entity)
|
|
259
|
-
const timeEntities = store.select(["time"]);
|
|
260
|
-
expect(timeEntities).toHaveLength(1);
|
|
261
|
-
// The resource entity should be included in time queries
|
|
262
|
-
const timeArchetypes = store.queryArchetypes(["time"]);
|
|
263
|
-
expect(timeArchetypes).toHaveLength(1);
|
|
264
|
-
});
|
|
265
|
-
});
|
|
266
|
-
// Store-specific resource tests
|
|
267
|
-
describe("Resource functionality", () => {
|
|
268
|
-
const timeSchema = {
|
|
269
|
-
type: "object",
|
|
270
|
-
properties: {
|
|
271
|
-
delta: F32.schema,
|
|
272
|
-
elapsed: F32.schema,
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
it("should create store with resources", () => {
|
|
276
|
-
const store = createStore({ components: { position: positionSchema }, resources: {
|
|
277
|
-
time: { default: { delta: 0.016, elapsed: 0 } },
|
|
278
|
-
config: { default: { debug: false, volume: 1.0 } }
|
|
279
|
-
}, archetypes: {} });
|
|
280
|
-
expect(store).toBeDefined();
|
|
281
|
-
expect(store.resources).toBeDefined();
|
|
282
|
-
expect(store.resources.time).toBeDefined();
|
|
283
|
-
expect(store.resources.config).toBeDefined();
|
|
284
|
-
});
|
|
285
|
-
it("should initialize resources with default values", () => {
|
|
286
|
-
const defaultTime = { delta: 0.016, elapsed: 0 };
|
|
287
|
-
const defaultConfig = { debug: false, volume: 1.0 };
|
|
288
|
-
const store = createStore({ components: { position: positionSchema }, resources: {
|
|
289
|
-
time: { default: defaultTime },
|
|
290
|
-
config: { default: defaultConfig }
|
|
291
|
-
}, archetypes: {} });
|
|
292
|
-
expect(store.resources.time).toEqual(defaultTime);
|
|
293
|
-
expect(store.resources.config).toEqual(defaultConfig);
|
|
294
|
-
});
|
|
295
|
-
it("should allow reading resource values", () => {
|
|
296
|
-
const store = createStore({ components: { position: positionSchema }, resources: {
|
|
297
|
-
time: { default: { delta: 0.016, elapsed: 0 } },
|
|
298
|
-
config: { default: { debug: false, volume: 1.0 } }
|
|
299
|
-
}, archetypes: {} });
|
|
300
|
-
expect(store.resources.time.delta).toBe(0.016);
|
|
301
|
-
expect(store.resources.time.elapsed).toBe(0);
|
|
302
|
-
expect(store.resources.config.debug).toBe(false);
|
|
303
|
-
expect(store.resources.config.volume).toBe(1.0);
|
|
304
|
-
});
|
|
305
|
-
it("should allow updating resource values", () => {
|
|
306
|
-
const store = createStore({ components: { position: positionSchema }, resources: {
|
|
307
|
-
time: { default: { delta: 0.016, elapsed: 0 } },
|
|
308
|
-
config: { default: { debug: false, volume: 1.0 } }
|
|
309
|
-
}, archetypes: {} });
|
|
310
|
-
// Update time
|
|
311
|
-
store.resources.time = { delta: 0.033, elapsed: 1.5 };
|
|
312
|
-
expect(store.resources.time.delta).toBe(0.033);
|
|
313
|
-
expect(store.resources.time.elapsed).toBe(1.5);
|
|
314
|
-
// Update config
|
|
315
|
-
store.resources.config = { debug: true, volume: 0.5 };
|
|
316
|
-
expect(store.resources.config.debug).toBe(true);
|
|
317
|
-
expect(store.resources.config.volume).toBe(0.5);
|
|
318
|
-
});
|
|
319
|
-
it("should maintain resource values across updates", () => {
|
|
320
|
-
const store = createStore({ components: { position: positionSchema }, resources: {
|
|
321
|
-
time: { default: { delta: 0.016, elapsed: 0 } },
|
|
322
|
-
config: { default: { debug: false, volume: 1.0 } }
|
|
323
|
-
}, archetypes: {} });
|
|
324
|
-
// Update multiple times
|
|
325
|
-
store.resources.time = { delta: 0.033, elapsed: 1.5 };
|
|
326
|
-
store.resources.time = { delta: 0.025, elapsed: 2.0 };
|
|
327
|
-
store.resources.config = { debug: true, volume: 0.5 };
|
|
328
|
-
// Verify final values
|
|
329
|
-
expect(store.resources.time).toEqual({ delta: 0.025, elapsed: 2.0 });
|
|
330
|
-
expect(store.resources.config).toEqual({ debug: true, volume: 0.5 });
|
|
331
|
-
});
|
|
332
|
-
it("should handle nested resource updates", () => {
|
|
333
|
-
const store = createStore({ components: { position: positionSchema }, resources: {
|
|
334
|
-
time: { default: { delta: 0.016, elapsed: 0 } }
|
|
335
|
-
}, archetypes: {} });
|
|
336
|
-
// Update individual properties
|
|
337
|
-
const newTime = { delta: 0.033, elapsed: 1.5 };
|
|
338
|
-
store.resources.time = newTime;
|
|
339
|
-
expect(store.resources.time.delta).toBe(newTime.delta);
|
|
340
|
-
expect(store.resources.time.elapsed).toBe(newTime.elapsed);
|
|
341
|
-
});
|
|
342
|
-
it("should work with empty resource object", () => {
|
|
343
|
-
const store = createStore({ components: { position: positionSchema }, resources: {}, archetypes: {} });
|
|
344
|
-
expect(store.resources).toBeDefined();
|
|
345
|
-
expect(Object.keys(store.resources)).toHaveLength(0);
|
|
346
|
-
});
|
|
347
|
-
it("should handle multiple resources independently", () => {
|
|
348
|
-
const store = createStore({ components: { position: positionSchema }, resources: {
|
|
349
|
-
time: { default: { delta: 0.016, elapsed: 0 } },
|
|
350
|
-
config: { default: { debug: false, volume: 1.0 } },
|
|
351
|
-
score: { default: 0 }
|
|
352
|
-
}, archetypes: {} });
|
|
353
|
-
// Update each resource independently
|
|
354
|
-
store.resources.time = { delta: 0.033, elapsed: 1.5 };
|
|
355
|
-
store.resources.config = { debug: true, volume: 0.5 };
|
|
356
|
-
store.resources.score = 100;
|
|
357
|
-
// Verify all resources maintain their values
|
|
358
|
-
expect(store.resources.time).toEqual({ delta: 0.033, elapsed: 1.5 });
|
|
359
|
-
expect(store.resources.config).toEqual({ debug: true, volume: 0.5 });
|
|
360
|
-
expect(store.resources.score).toBe(100);
|
|
361
|
-
});
|
|
362
|
-
it("should allow querying resources as components", () => {
|
|
363
|
-
const store = createStore({ components: {
|
|
364
|
-
position: positionSchema,
|
|
365
|
-
time: timeSchema
|
|
366
|
-
}, resources: {
|
|
367
|
-
time: { default: { delta: 0.016, elapsed: 0 } }
|
|
368
|
-
}, archetypes: {} });
|
|
369
|
-
// Resources should be queryable as components
|
|
370
|
-
const timeArchetypes = store.queryArchetypes(["time"]);
|
|
371
|
-
expect(timeArchetypes).toHaveLength(1);
|
|
372
|
-
expect(timeArchetypes[0].components.has("time")).toBe(true);
|
|
373
|
-
});
|
|
374
|
-
it("should maintain resource singleton behavior", () => {
|
|
375
|
-
const store = createStore({ components: {
|
|
376
|
-
position: positionSchema,
|
|
377
|
-
time: timeSchema
|
|
378
|
-
}, resources: {
|
|
379
|
-
time: { default: { delta: 0.016, elapsed: 0 } }
|
|
380
|
-
}, archetypes: {} });
|
|
381
|
-
// Resources should be queryable as components
|
|
382
|
-
const timeArchetypes = store.queryArchetypes(["time"]);
|
|
383
|
-
expect(timeArchetypes).toHaveLength(1);
|
|
384
|
-
// Resources should maintain their values
|
|
385
|
-
expect(store.resources.time).toEqual({ delta: 0.016, elapsed: 0 });
|
|
386
|
-
// Update and verify
|
|
387
|
-
store.resources.time = { delta: 0.033, elapsed: 1.5 };
|
|
388
|
-
expect(store.resources.time).toEqual({ delta: 0.033, elapsed: 1.5 });
|
|
389
|
-
});
|
|
390
|
-
it("should handle primitive resource values", () => {
|
|
391
|
-
const store = createStore({ components: { position: positionSchema }, resources: {
|
|
392
|
-
score: { default: 0 },
|
|
393
|
-
name: { default: "Player1" },
|
|
394
|
-
active: { default: true }
|
|
395
|
-
}, archetypes: {} });
|
|
396
|
-
expect(store.resources.score).toBe(0);
|
|
397
|
-
expect(store.resources.name).toBe("Player1");
|
|
398
|
-
expect(store.resources.active).toBe(true);
|
|
399
|
-
// Update primitive values
|
|
400
|
-
store.resources.score = 100;
|
|
401
|
-
store.resources.name = "Player2";
|
|
402
|
-
store.resources.active = false;
|
|
403
|
-
expect(store.resources.score).toBe(100);
|
|
404
|
-
expect(store.resources.name).toBe("Player2");
|
|
405
|
-
expect(store.resources.active).toBe(false);
|
|
406
|
-
});
|
|
407
|
-
it("should handle complex resource objects", () => {
|
|
408
|
-
const complexResource = {
|
|
409
|
-
nested: {
|
|
410
|
-
deep: {
|
|
411
|
-
value: 42,
|
|
412
|
-
array: [1, 2, 3],
|
|
413
|
-
flag: true
|
|
414
|
-
}
|
|
415
|
-
},
|
|
416
|
-
count: 0
|
|
417
|
-
};
|
|
418
|
-
const store = createStore({ components: { position: positionSchema }, resources: { complex: { default: complexResource } }, archetypes: {} });
|
|
419
|
-
expect(store.resources.complex).toEqual(complexResource);
|
|
420
|
-
// Update complex resource
|
|
421
|
-
const updatedComplex = {
|
|
422
|
-
nested: {
|
|
423
|
-
deep: {
|
|
424
|
-
value: 100,
|
|
425
|
-
array: [4, 5, 6],
|
|
426
|
-
flag: false
|
|
427
|
-
}
|
|
428
|
-
},
|
|
429
|
-
count: 10
|
|
430
|
-
};
|
|
431
|
-
store.resources.complex = updatedComplex;
|
|
432
|
-
expect(store.resources.complex).toEqual(updatedComplex);
|
|
433
|
-
});
|
|
434
|
-
it("should handle array resource schemas", () => {
|
|
435
|
-
const store = createStore({ components: { position: positionSchema }, resources: {
|
|
436
|
-
tags: {
|
|
437
|
-
type: "array",
|
|
438
|
-
items: { type: "string" },
|
|
439
|
-
default: ["player", "active"]
|
|
440
|
-
}
|
|
441
|
-
}, archetypes: {} });
|
|
442
|
-
expect(store.resources.tags).toEqual(["player", "active"]);
|
|
443
|
-
// Update array resource
|
|
444
|
-
store.resources.tags = ["enemy", "boss", "elite"];
|
|
445
|
-
expect(store.resources.tags).toEqual(["enemy", "boss", "elite"]);
|
|
446
|
-
});
|
|
447
|
-
});
|
|
448
|
-
describe("Archetype functionality", () => {
|
|
449
|
-
it("should create store with archetypes", () => {
|
|
450
|
-
const store = createStore({ components: {
|
|
451
|
-
name: { type: "string" },
|
|
452
|
-
health: { type: "number" },
|
|
453
|
-
enabled: { type: "boolean" },
|
|
454
|
-
}, resources: {}, archetypes: {
|
|
455
|
-
Player: ["name", "health"],
|
|
456
|
-
} });
|
|
457
|
-
const entity = store.archetypes.Player.insert({
|
|
458
|
-
name: "test",
|
|
459
|
-
health: 100,
|
|
460
|
-
});
|
|
461
|
-
expect(store.archetypes.Player.columns.name.get(entity)).toEqual("test");
|
|
462
|
-
expect(store.archetypes.Player.columns.health.get(entity)).toEqual(100);
|
|
463
|
-
});
|
|
464
|
-
});
|
|
465
|
-
// TimeSchema round-trip test
|
|
466
|
-
describe("TimeSchema functionality", () => {
|
|
467
|
-
it("should store and retrieve Date.now() value correctly", () => {
|
|
468
|
-
const store = createStore({ components: {
|
|
469
|
-
timestamp: Time.schema,
|
|
470
|
-
}, resources: {}, archetypes: {} });
|
|
471
|
-
// Create entity with current timestamp
|
|
472
|
-
const now = Date.now();
|
|
473
|
-
const archetype = store.ensureArchetype(["id", "timestamp"]);
|
|
474
|
-
const entity = archetype.insert({ timestamp: now });
|
|
475
|
-
// Query for the entity
|
|
476
|
-
const entities = store.select(["timestamp"]);
|
|
477
|
-
expect(entities).toHaveLength(1);
|
|
478
|
-
expect(entities[0]).toBe(entity);
|
|
479
|
-
// Read the stored value and verify it matches original
|
|
480
|
-
const storedData = store.read(entity);
|
|
481
|
-
expect(storedData).not.toBeNull();
|
|
482
|
-
expect(storedData.timestamp).toBe(now);
|
|
483
|
-
});
|
|
484
|
-
});
|
|
485
|
-
// Serialization/Deserialization tests
|
|
486
|
-
describe("toData/fromData functionality", () => {
|
|
487
|
-
it("should serialize and deserialize store with resources correctly", () => {
|
|
488
|
-
const store = createStore({ components: {
|
|
489
|
-
position: positionSchema,
|
|
490
|
-
health: healthSchema,
|
|
491
|
-
}, resources: {
|
|
492
|
-
time: { default: { delta: 0.016, elapsed: 0 } },
|
|
493
|
-
config: { default: { debug: false, volume: 1.0 } }
|
|
494
|
-
}, archetypes: {} });
|
|
495
|
-
// Add some entities
|
|
496
|
-
const archetype = store.ensureArchetype(["id", "position", "health"]);
|
|
497
|
-
const entity1 = archetype.insert({
|
|
498
|
-
position: { x: 1, y: 2, z: 3 },
|
|
499
|
-
health: { current: 100, max: 100 }
|
|
500
|
-
});
|
|
501
|
-
const entity2 = archetype.insert({
|
|
502
|
-
position: { x: 4, y: 5, z: 6 },
|
|
503
|
-
health: { current: 50, max: 100 }
|
|
504
|
-
});
|
|
505
|
-
// Update resources
|
|
506
|
-
store.resources.time = { delta: 0.033, elapsed: 1.5 };
|
|
507
|
-
store.resources.config = { debug: true, volume: 0.5 };
|
|
508
|
-
// Serialize the store
|
|
509
|
-
const serializedData = store.toData();
|
|
510
|
-
// Create a new store with the same schemas and restore
|
|
511
|
-
const newStore = createStore({ components: {
|
|
512
|
-
position: positionSchema,
|
|
513
|
-
health: healthSchema,
|
|
514
|
-
}, resources: {
|
|
515
|
-
time: { default: { delta: 0.016, elapsed: 0 } },
|
|
516
|
-
config: { default: { debug: false, volume: 1.0 } }
|
|
517
|
-
}, archetypes: {} });
|
|
518
|
-
newStore.fromData(serializedData);
|
|
519
|
-
// Verify entities are restored
|
|
520
|
-
const restoredEntities = newStore.select(["position", "health"]);
|
|
521
|
-
expect(restoredEntities).toHaveLength(2);
|
|
522
|
-
// Verify entity data is correct
|
|
523
|
-
const restoredData1 = newStore.read(restoredEntities[0]);
|
|
524
|
-
const restoredData2 = newStore.read(restoredEntities[1]);
|
|
525
|
-
expect(restoredData1).toEqual({
|
|
526
|
-
id: restoredEntities[0],
|
|
527
|
-
position: { x: 1, y: 2, z: 3 },
|
|
528
|
-
health: { current: 100, max: 100 }
|
|
529
|
-
});
|
|
530
|
-
expect(restoredData2).toEqual({
|
|
531
|
-
id: restoredEntities[1],
|
|
532
|
-
position: { x: 4, y: 5, z: 6 },
|
|
533
|
-
health: { current: 50, max: 100 }
|
|
534
|
-
});
|
|
535
|
-
// Verify resources are restored
|
|
536
|
-
expect(newStore.resources.time).toEqual({ delta: 0.033, elapsed: 1.5 });
|
|
537
|
-
expect(newStore.resources.config).toEqual({ debug: true, volume: 0.5 });
|
|
538
|
-
});
|
|
539
|
-
it("should create new resources when restoring to store with additional resources", () => {
|
|
540
|
-
// Create original store with only one resource
|
|
541
|
-
const originalStore = createStore({ components: {
|
|
542
|
-
position: positionSchema,
|
|
543
|
-
}, resources: {
|
|
544
|
-
time: { default: { delta: 0.016, elapsed: 0 } }
|
|
545
|
-
}, archetypes: {} });
|
|
546
|
-
// Add some entities and update resource
|
|
547
|
-
const archetype = originalStore.ensureArchetype(["id", "position"]);
|
|
548
|
-
archetype.insert({ position: { x: 1, y: 2, z: 3 } });
|
|
549
|
-
originalStore.resources.time = { delta: 0.033, elapsed: 1.5 };
|
|
550
|
-
// Serialize the store
|
|
551
|
-
const serializedData = originalStore.toData();
|
|
552
|
-
// Create new store with additional resources
|
|
553
|
-
// Note: This is a limitation - when restoring to a store with different archetype structure,
|
|
554
|
-
// entity locations may not be preserved correctly due to archetype ID shifts.
|
|
555
|
-
// In practice, stores should be restored to compatible configurations.
|
|
556
|
-
const newStore = createStore({ components: {
|
|
557
|
-
position: positionSchema,
|
|
558
|
-
}, resources: {
|
|
559
|
-
time: { default: { delta: 0.016, elapsed: 0 } },
|
|
560
|
-
config: { default: { debug: false, volume: 1.0 } },
|
|
561
|
-
score: { default: 0 }
|
|
562
|
-
}, archetypes: {} });
|
|
563
|
-
// Restore from serialized data
|
|
564
|
-
newStore.fromData(serializedData);
|
|
565
|
-
// Verify original resource is restored
|
|
566
|
-
expect(newStore.resources.time).toEqual({ delta: 0.033, elapsed: 1.5 });
|
|
567
|
-
// Verify new resources are created with default values
|
|
568
|
-
expect(newStore.resources.config).toEqual({ debug: false, volume: 1.0 });
|
|
569
|
-
expect(newStore.resources.score).toBe(0);
|
|
570
|
-
// Verify new resources are writable
|
|
571
|
-
newStore.resources.config = { debug: true, volume: 0.5 };
|
|
572
|
-
newStore.resources.score = 100;
|
|
573
|
-
expect(newStore.resources.config).toEqual({ debug: true, volume: 0.5 });
|
|
574
|
-
expect(newStore.resources.score).toBe(100);
|
|
575
|
-
// Note: Due to archetype ID shifts when adding new resources,
|
|
576
|
-
// the original entity may not be preserved correctly.
|
|
577
|
-
// This is a limitation of the current serialization approach.
|
|
578
|
-
// In practice, stores should be restored to compatible configurations.
|
|
579
|
-
});
|
|
580
|
-
it("should handle restoring to store with fewer resources", () => {
|
|
581
|
-
// Create original store with multiple resources
|
|
582
|
-
const originalStore = createStore({ components: {
|
|
583
|
-
position: positionSchema,
|
|
584
|
-
}, resources: {
|
|
585
|
-
time: { default: { delta: 0.016, elapsed: 0 } },
|
|
586
|
-
config: { default: { debug: false, volume: 1.0 } },
|
|
587
|
-
score: { default: 0 }
|
|
588
|
-
}, archetypes: {} });
|
|
589
|
-
// Add entities and update resources
|
|
590
|
-
const archetype = originalStore.ensureArchetype(["id", "position"]);
|
|
591
|
-
const entity = archetype.insert({ position: { x: 1, y: 2, z: 3 } });
|
|
592
|
-
originalStore.resources.time = { delta: 0.033, elapsed: 1.5 };
|
|
593
|
-
originalStore.resources.config = { debug: true, volume: 0.5 };
|
|
594
|
-
originalStore.resources.score = 100;
|
|
595
|
-
// Serialize the store
|
|
596
|
-
const serializedData = originalStore.toData();
|
|
597
|
-
// Create new store with only one resource
|
|
598
|
-
const newStore = createStore({ components: {
|
|
599
|
-
position: positionSchema,
|
|
600
|
-
}, resources: {
|
|
601
|
-
time: { default: { delta: 0.016, elapsed: 0 } }
|
|
602
|
-
}, archetypes: {} });
|
|
603
|
-
// Restore from serialized data
|
|
604
|
-
newStore.fromData(serializedData);
|
|
605
|
-
// Verify the remaining resource is restored
|
|
606
|
-
expect(newStore.resources.time).toEqual({ delta: 0.033, elapsed: 1.5 });
|
|
607
|
-
// Verify only the time resource exists
|
|
608
|
-
expect(newStore.resources).toHaveProperty('time');
|
|
609
|
-
expect(newStore.resources).not.toHaveProperty('config');
|
|
610
|
-
expect(newStore.resources).not.toHaveProperty('score');
|
|
611
|
-
// Verify entity is still there
|
|
612
|
-
const restoredEntities = newStore.select(["position"]);
|
|
613
|
-
expect(restoredEntities).toHaveLength(1);
|
|
614
|
-
const restoredData = newStore.read(restoredEntities[0]);
|
|
615
|
-
expect(restoredData).toEqual({
|
|
616
|
-
id: restoredEntities[0],
|
|
617
|
-
position: { x: 1, y: 2, z: 3 }
|
|
618
|
-
});
|
|
619
|
-
});
|
|
620
|
-
it("should preserve resource getter/setter functionality after restoration", () => {
|
|
621
|
-
const store = createStore({ components: {
|
|
622
|
-
position: positionSchema,
|
|
623
|
-
}, resources: {
|
|
624
|
-
time: { default: { delta: 0.016, elapsed: 0 } }
|
|
625
|
-
}, archetypes: {} });
|
|
626
|
-
// Update resource
|
|
627
|
-
store.resources.time = { delta: 0.033, elapsed: 1.5 };
|
|
628
|
-
// Serialize and deserialize
|
|
629
|
-
const serializedData = store.toData();
|
|
630
|
-
const newStore = createStore({ components: {
|
|
631
|
-
position: positionSchema,
|
|
632
|
-
}, resources: {
|
|
633
|
-
time: { default: { delta: 0.016, elapsed: 0 } }
|
|
634
|
-
}, archetypes: {} });
|
|
635
|
-
newStore.fromData(serializedData);
|
|
636
|
-
// Verify resource is restored
|
|
637
|
-
expect(newStore.resources.time).toEqual({ delta: 0.033, elapsed: 1.5 });
|
|
638
|
-
// Verify getter/setter still works
|
|
639
|
-
newStore.resources.time = { delta: 0.025, elapsed: 2.0 };
|
|
640
|
-
expect(newStore.resources.time).toEqual({ delta: 0.025, elapsed: 2.0 });
|
|
641
|
-
// Verify the underlying archetype is updated
|
|
642
|
-
const timeArchetypes = newStore.queryArchetypes(["time"]);
|
|
643
|
-
expect(timeArchetypes).toHaveLength(1);
|
|
644
|
-
expect(timeArchetypes[0].rowCount).toBe(1);
|
|
645
|
-
expect(timeArchetypes[0].columns.time.get(0)).toEqual({ delta: 0.025, elapsed: 2.0 });
|
|
646
|
-
});
|
|
647
|
-
it("should handle complex resource objects during serialization", () => {
|
|
648
|
-
const complexResource = {
|
|
649
|
-
nested: {
|
|
650
|
-
deep: {
|
|
651
|
-
value: 42,
|
|
652
|
-
array: [1, 2, 3],
|
|
653
|
-
flag: true
|
|
654
|
-
}
|
|
655
|
-
},
|
|
656
|
-
count: 0
|
|
657
|
-
};
|
|
658
|
-
const store = createStore({ components: {
|
|
659
|
-
position: positionSchema,
|
|
660
|
-
}, resources: {
|
|
661
|
-
complex: { default: complexResource }
|
|
662
|
-
}, archetypes: {} });
|
|
663
|
-
// Update complex resource
|
|
664
|
-
const updatedComplex = {
|
|
665
|
-
nested: {
|
|
666
|
-
deep: {
|
|
667
|
-
value: 100,
|
|
668
|
-
array: [4, 5, 6],
|
|
669
|
-
flag: false
|
|
670
|
-
}
|
|
671
|
-
},
|
|
672
|
-
count: 10
|
|
673
|
-
};
|
|
674
|
-
store.resources.complex = updatedComplex;
|
|
675
|
-
// Add some entities
|
|
676
|
-
const archetype = store.ensureArchetype(["id", "position"]);
|
|
677
|
-
archetype.insert({ position: { x: 1, y: 2, z: 3 } });
|
|
678
|
-
// Serialize and deserialize
|
|
679
|
-
const serializedData = store.toData();
|
|
680
|
-
const newStore = createStore({ components: {
|
|
681
|
-
position: positionSchema,
|
|
682
|
-
}, resources: {
|
|
683
|
-
complex: { default: complexResource }
|
|
684
|
-
}, archetypes: {} });
|
|
685
|
-
newStore.fromData(serializedData);
|
|
686
|
-
// Verify complex resource is restored correctly
|
|
687
|
-
expect(newStore.resources.complex).toEqual(updatedComplex);
|
|
688
|
-
// Verify it's still writable
|
|
689
|
-
const newComplex = { ...updatedComplex, count: 20 };
|
|
690
|
-
newStore.resources.complex = newComplex;
|
|
691
|
-
expect(newStore.resources.complex).toEqual(newComplex);
|
|
692
|
-
});
|
|
693
|
-
it("should handle empty resource schemas during restoration", () => {
|
|
694
|
-
// Create store with resources
|
|
695
|
-
const store = createStore({ components: {
|
|
696
|
-
position: positionSchema,
|
|
697
|
-
}, resources: {
|
|
698
|
-
time: { default: { delta: 0.016, elapsed: 0 } }
|
|
699
|
-
}, archetypes: {} });
|
|
700
|
-
// Add entities and update resource
|
|
701
|
-
const archetype = store.ensureArchetype(["id", "position"]);
|
|
702
|
-
archetype.insert({ position: { x: 1, y: 2, z: 3 } });
|
|
703
|
-
store.resources.time = { delta: 0.033, elapsed: 1.5 };
|
|
704
|
-
// Serialize
|
|
705
|
-
const serializedData = store.toData();
|
|
706
|
-
// Create new store with no resources
|
|
707
|
-
const newStore = createStore({ components: {
|
|
708
|
-
position: positionSchema,
|
|
709
|
-
}, resources: {}, archetypes: {} });
|
|
710
|
-
// Restore - should not crash and should preserve entities
|
|
711
|
-
newStore.fromData(serializedData);
|
|
712
|
-
// Verify entities are preserved
|
|
713
|
-
const restoredEntities = newStore.select(["position"]);
|
|
714
|
-
expect(restoredEntities).toHaveLength(1);
|
|
715
|
-
const restoredData = newStore.read(restoredEntities[0]);
|
|
716
|
-
expect(restoredData).toEqual({
|
|
717
|
-
id: restoredEntities[0],
|
|
718
|
-
position: { x: 1, y: 2, z: 3 }
|
|
719
|
-
});
|
|
720
|
-
// Verify no resources exist
|
|
721
|
-
expect(Object.keys(newStore.resources)).toHaveLength(0);
|
|
722
|
-
});
|
|
723
|
-
});
|
|
724
|
-
});
|
|
725
|
-
//# sourceMappingURL=create-store.test.js.map
|