bard-legends-framework 0.10.9 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/actions-performance.test.d.ts +1 -0
- package/dist/actions-performance.test.js +83 -0
- package/dist/game-entities/controller/controller.d.ts +2 -3
- package/dist/game-entities/controller/controller.js +9 -8
- package/dist/game-entities/controller/controller.test.js +2 -2
- package/dist/game-entities/entity/entity.d.ts +11 -9
- package/dist/game-entities/entity/entity.js +20 -16
- package/dist/game-entities/entity/entity.test.js +116 -147
- package/dist/game-entities/entity/helpers/entity-store.helper.d.ts +6 -9
- package/dist/game-entities/entity/helpers/entity-store.helper.js +22 -57
- package/dist/game-entities/entity/helpers/entity-store.helper.test.d.ts +1 -0
- package/dist/game-entities/entity/helpers/entity-store.helper.test.js +136 -0
- package/dist/game-entities/entity/helpers/entity-views.helper.d.ts +7 -7
- package/dist/game-entities/entity/helpers/entity-views.helper.js +28 -23
- package/dist/game-entities/entity/singleton-entity.d.ts +3 -3
- package/dist/game-entities/entity/singleton-entity.js +1 -1
- package/dist/game-entities/entity/singleton-entity.test.js +9 -31
- package/dist/game-entities/hard-reset.d.ts +5 -0
- package/dist/game-entities/hard-reset.js +14 -0
- package/dist/game-entities/index.d.ts +1 -3
- package/dist/game-entities/index.js +3 -7
- package/dist/game-entities/scene/scene.d.ts +15 -15
- package/dist/game-entities/scene/scene.js +61 -60
- package/dist/game-entities/scene/scene.test.js +97 -67
- package/dist/game-entities/service/service.d.ts +1 -4
- package/dist/game-entities/service/service.js +15 -14
- package/dist/game-entities/service/service.test.js +33 -38
- package/dist/game-entities/unit-test.helper.d.ts +5 -0
- package/dist/game-entities/unit-test.helper.js +14 -0
- package/dist/game-entities/update-cycle.d.ts +10 -9
- package/dist/game-entities/update-cycle.js +34 -23
- package/dist/game-entities/view/view.d.ts +10 -11
- package/dist/game-entities/view/view.js +17 -35
- package/dist/game-entities/view/view.test.js +73 -250
- package/dist/physics/entity-types/immovable-physics-entity.d.ts +2 -4
- package/dist/physics/entity-types/immovable-physics-entity.js +4 -6
- package/dist/physics/entity-types/movable-entity.d.ts +1 -1
- package/dist/physics/entity-types/movable-entity.js +6 -6
- package/dist/physics/entity-types/movable-physics-entity.d.ts +10 -11
- package/dist/physics/entity-types/movable-physics-entity.js +31 -32
- package/dist/physics/entity-types/physics-entity.d.ts +12 -15
- package/dist/physics/entity-types/physics-entity.js +30 -28
- package/dist/physics/interfaces.d.ts +6 -6
- package/dist/physics/interfaces.js +4 -4
- package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics-internal.controller.d.ts +16 -16
- package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics-internal.controller.js +22 -22
- package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics.controller.d.ts +20 -20
- package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics.controller.js +30 -30
- package/dist/physics/module//342/232/234/357/270/217gateways/dtos/requests.dto.d.ts +3 -3
- package/dist/physics/module//342/232/234/357/270/217gateways/physics-internal.gateway.d.ts +10 -10
- package/dist/physics/module//342/232/234/357/270/217gateways/physics-internal.gateway.js +16 -16
- package/dist/physics/module//342/232/234/357/270/217gateways/physics.gateway.d.ts +11 -11
- package/dist/physics/module//342/232/234/357/270/217gateways/physics.gateway.js +18 -18
- package/dist/physics/module//360/237/223/220services/collision/collisions.service.d.ts +5 -5
- package/dist/physics/module//360/237/223/220services/collision/collisions.service.js +17 -17
- package/dist/physics/module//360/237/223/220services/collision/hit-test.service.d.ts +4 -4
- package/dist/physics/module//360/237/223/220services/collision/hit-test.service.js +11 -11
- package/dist/physics/module//360/237/223/220services/collision/physics-body-group.service.d.ts +2 -2
- package/dist/physics/module//360/237/223/220services/collision/physics-body-group.service.js +4 -4
- package/dist/physics/module//360/237/223/220services/creation/border.service.d.ts +2 -2
- package/dist/physics/module//360/237/223/220services/creation/border.service.js +9 -9
- package/dist/physics/module//360/237/223/220services/creation/materials.service.d.ts +7 -7
- package/dist/physics/module//360/237/223/220services/creation/materials.service.js +17 -17
- package/dist/physics/module//360/237/223/220services/creation/physics-world.service.d.ts +11 -11
- package/dist/physics/module//360/237/223/220services/creation/physics-world.service.js +28 -27
- package/dist/physics/module//360/237/223/220services/creation/shape-creation.service.d.ts +4 -4
- package/dist/physics/module//360/237/223/220services/creation/shape-creation.service.js +13 -13
- package/dist/physics/module//360/237/223/220services/impact/eliptic-explosion.service.d.ts +9 -9
- package/dist/physics/module//360/237/223/220services/impact/eliptic-explosion.service.js +19 -19
- package/dist/physics/module//360/237/223/220services/impact/explosion.service.d.ts +9 -9
- package/dist/physics/module//360/237/223/220services/impact/explosion.service.js +20 -20
- package/dist/physics/module//360/237/223/220services/impact/ray-cast-hit-converter.d.ts +1 -1
- package/dist/physics/module//360/237/223/220services/impact/ray-cast-hit-converter.js +4 -4
- package/dist/physics/module//360/237/223/220services/path-finding/availability-grid-cache.service.d.ts +2 -2
- package/dist/physics/module//360/237/223/220services/path-finding/availability-grid-cache.service.js +3 -3
- package/dist/physics/module//360/237/223/220services/path-finding/availability-grid.service.d.ts +5 -5
- package/dist/physics/module//360/237/223/220services/path-finding/availability-grid.service.js +13 -13
- package/dist/physics/module//360/237/223/220services/path-finding/path-finder.service.d.ts +4 -4
- package/dist/physics/module//360/237/223/220services/path-finding/path-finder.service.js +13 -13
- package/dist/physics/module//360/237/223/220services/query/physics-query.service.d.ts +4 -4
- package/dist/physics/module//360/237/223/220services/query/physics-query.service.js +4 -4
- package/dist/physics/module//360/237/223/220services/ray-casting/ray-casting.service.d.ts +1 -4
- package/dist/physics/module//360/237/223/220services/ray-casting/ray-casting.service.js +7 -15
- package/dist/physics/module//360/237/223/220services/test-visuals/test-visuals.service.d.ts +9 -9
- package/dist/physics/module//360/237/223/220services/test-visuals/test-visuals.service.js +60 -49
- package/dist/physics/module//360/237/247/212entities/border.entity.d.ts +1 -1
- package/dist/physics/module//360/237/247/212entities/border.entity.js +3 -3
- package/dist/physics/module//360/237/247/212entities/physics-world.entity.js +2 -2
- package/dist/pixi/components/display-object-array.d.ts +5 -5
- package/dist/pixi/components/display-object-array.js +14 -14
- package/dist/pixi/components/helpers/smooth-scroller.d.ts +7 -7
- package/dist/pixi/components/helpers/smooth-scroller.js +23 -23
- package/dist/pixi/components/helpers/smooth-scroller.test.js +14 -14
- package/dist/pixi/components/menu/menu-entity.d.ts +14 -0
- package/dist/pixi/components/menu/menu-entity.js +48 -0
- package/dist/pixi/components/menu/menu.ui.d.ts +23 -0
- package/dist/pixi/components/menu/menu.ui.js +97 -0
- package/dist/pixi/components/mouse-wheel-listener.ui.d.ts +4 -3
- package/dist/pixi/components/mouse-wheel-listener.ui.js +15 -14
- package/dist/pixi/components/scroll-area.ui.d.ts +1 -1
- package/dist/pixi/components/scroll-area.ui.js +9 -9
- package/dist/pixi/components/scroll-mask.ui.d.ts +9 -8
- package/dist/pixi/components/scroll-mask.ui.js +25 -24
- package/dist/pixi/display-object/container-attributes.d.ts +24 -26
- package/dist/pixi/display-object/container-attributes.js +27 -28
- package/dist/pixi/display-object/container.d.ts +3 -6
- package/dist/pixi/display-object/container.js +2 -12
- package/dist/pixi/display-object/filters/base-filters/blur.filter.d.ts +9 -9
- package/dist/pixi/display-object/filters/base-filters/blur.filter.js +25 -25
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.filter.d.ts +7 -7
- package/dist/pixi/display-object/filters/base-filters/expand-with-color.filter.js +17 -17
- package/dist/pixi/display-object/filters/composite-filters/glow-filter.d.ts +6 -6
- package/dist/pixi/display-object/filters/composite-filters/glow-filter.js +10 -11
- package/dist/pixi/display-object/filters/helpers/gaussian-values.helper.d.ts +2 -2
- package/dist/pixi/display-object/filters/helpers/gaussian-values.helper.js +5 -5
- package/dist/pixi/display-object/filters/templates/checking-neighbors.template.d.ts +5 -5
- package/dist/pixi/display-object/filters/templates/checking-neighbors.template.js +8 -8
- package/dist/pixi/display-object/filters/templates/plane.template.d.ts +5 -5
- package/dist/pixi/display-object/filters/templates/plane.template.js +7 -7
- package/dist/pixi/display-object/filters.d.ts +7 -7
- package/dist/pixi/display-object/filters.js +34 -34
- package/dist/pixi/display-object/index.d.ts +1 -1
- package/dist/pixi/display-object/objects/graphics/graphics.d.ts +9 -9
- package/dist/pixi/display-object/objects/graphics/graphics.js +25 -25
- package/dist/pixi/display-object/objects/placeholder.d.ts +1 -1
- package/dist/pixi/display-object/objects/placeholder.js +7 -7
- package/dist/pixi/display-object/objects/sprite/glow-sprite-generator.d.ts +9 -9
- package/dist/pixi/display-object/objects/sprite/glow-sprite-generator.js +29 -26
- package/dist/pixi/display-object/objects/sprite/sprite.d.ts +10 -9
- package/dist/pixi/display-object/objects/sprite/sprite.js +62 -53
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/pixi-text-style-converter.d.ts +4 -3
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.d.ts +6 -6
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.js +16 -16
- package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.test.js +28 -28
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/consistent-space-text-wrapper.d.ts +1 -1
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/consistent-space-text-wrapper.js +3 -3
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/rich-text-typewriter.d.ts +17 -17
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/rich-text-typewriter.js +62 -62
- package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/rich-text-typewriter.test.js +2 -2
- package/dist/pixi/display-object/objects/text/helpers/process-steps/3-data-out-converter/rich-text-data-out-converter.d.ts +3 -3
- package/dist/pixi/display-object/objects/text/helpers/process-steps/3-data-out-converter/rich-text-data-out-converter.js +6 -6
- package/dist/pixi/display-object/objects/text/helpers/process-steps/3-data-out-converter/rich-text-data-out-converter.test.js +12 -12
- package/dist/pixi/display-object/objects/text/helpers/rich-text-to-plane-text.d.ts +2 -2
- package/dist/pixi/display-object/objects/text/helpers/rich-text-to-plane-text.test.js +5 -5
- package/dist/pixi/display-object/objects/text/rich-text.d.ts +0 -1
- package/dist/pixi/display-object/objects/text/rich-text.js +0 -1
- package/dist/pixi/display-object/objects/text/text.d.ts +9 -10
- package/dist/pixi/display-object/objects/text/text.js +34 -35
- package/dist/pixi/game.d.ts +26 -17
- package/dist/pixi/game.js +53 -39
- package/dist/pixi/helpers/game-assets.d.ts +5 -5
- package/dist/pixi/helpers/game-assets.js +14 -11
- package/dist/pixi/helpers/position-conversion.helper.d.ts +4 -4
- package/dist/pixi/helpers/position-conversion.helper.js +3 -3
- package/dist/pixi/index.d.ts +3 -37
- package/dist/pixi/index.js +6 -22
- package/dist/pixi/modules/CAMERA/camera.d.ts +5 -4
- package/dist/pixi/modules/CAMERA/camera.js +9 -9
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera-view.gateway.d.ts +3 -2
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera-view.gateway.js +1 -1
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera-view.controller.d.ts +3 -2
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera-view.controller.js +5 -5
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.d.ts +3 -3
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.js +7 -7
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/dtos/requests.dto.d.ts +8 -8
- package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/dtos/requests.dto.js +8 -8
- package/dist/pixi/modules/CAMERA//360/237/223/220services/camera.service.d.ts +2 -2
- package/dist/pixi/modules/CAMERA//360/237/223/220services/camera.service.js +12 -12
- package/dist/pixi/modules/CAMERA//360/237/247/212entities/camera.entity.js +4 -4
- package/dist/pixi/modules/CAMERA//360/237/247/251views/camera.view.d.ts +17 -16
- package/dist/pixi/modules/CAMERA//360/237/247/251views/camera.view.js +50 -49
- package/dist/pixi/pixi-definitions.d.ts +38 -0
- package/dist/pixi/pixi-definitions.js +37 -0
- package/dist/pixi/services/keyboard/keyboard.d.ts +6 -4
- package/dist/pixi/services/keyboard/keyboard.js +15 -13
- package/dist/pixi/services/mouse/mouse-target-focus.service.d.ts +12 -11
- package/dist/pixi/services/mouse/mouse-target-focus.service.js +31 -30
- package/dist/pixi/services/mouse/mouse.service.d.ts +16 -6
- package/dist/pixi/services/mouse/mouse.service.js +42 -22
- package/dist/utilities/animator/animating-content/fade-in-content.d.ts +18 -0
- package/dist/utilities/animator/animating-content/fade-in-content.js +37 -0
- package/dist/utilities/animator/animating-content/fade-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/animating-content/fade-in-content.test.js +10 -0
- package/dist/utilities/animator/animating-content/slide-in-content.d.ts +37 -0
- package/dist/utilities/animator/animating-content/slide-in-content.js +99 -0
- package/dist/utilities/animator/animating-content/slide-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/animating-content/slide-in-content.test.js +10 -0
- package/dist/utilities/animator/animations.d.ts +45 -0
- package/dist/utilities/animator/animations.js +92 -0
- package/dist/utilities/animator/animator/animator.d.ts +44 -0
- package/dist/utilities/animator/animator/animator.js +234 -0
- package/dist/utilities/animator/animator/animator.memory-leak.test.d.ts +1 -0
- package/dist/utilities/animator/animator/animator.memory-leak.test.js +73 -0
- package/dist/utilities/animator/animator/animator.performance.test.d.ts +1 -0
- package/dist/utilities/animator/animator/animator.performance.test.js +116 -0
- package/dist/utilities/animator/animator/animator.test.d.ts +1 -0
- package/dist/utilities/animator/animator/animator.test.js +1046 -0
- package/dist/utilities/animator/animator.d.ts +60 -0
- package/dist/utilities/animator/animator.js +322 -0
- package/dist/utilities/animator/animator.performance.test.d.ts +1 -0
- package/dist/utilities/animator/animator.performance.test.js +46 -0
- package/dist/utilities/animator/animator.test.d.ts +1 -0
- package/dist/utilities/animator/animator.test.js +928 -0
- package/dist/utilities/animator/animator2/animator.d.ts +42 -0
- package/dist/utilities/animator/animator2/animator.js +222 -0
- package/dist/utilities/animator/animator2/animator.memory-leak.test.d.ts +1 -0
- package/dist/utilities/animator/animator2/animator.memory-leak.test.js +73 -0
- package/dist/utilities/animator/animator2/animator.performance.test.d.ts +1 -0
- package/dist/utilities/animator/animator2/animator.performance.test.js +65 -0
- package/dist/utilities/animator/animator2/animator.test.d.ts +1 -0
- package/dist/utilities/animator/animator2/animator.test.js +1007 -0
- package/dist/utilities/animator/animator_old/animator.d.ts +60 -0
- package/dist/utilities/animator/animator_old/animator.js +337 -0
- package/dist/utilities/animator/animator_old/animator.performance.test.d.ts +1 -0
- package/dist/utilities/animator/animator_old/animator.performance.test.js +121 -0
- package/dist/utilities/animator/animator_old/animator.test.d.ts +1 -0
- package/dist/utilities/animator/animator_old/animator.test.js +996 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-content.d.ts +18 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-content.js +37 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-content.test.js +10 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.d.ts +38 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.js +208 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.test.js +439 -0
- package/dist/utilities/animator/content-animations/slide/slide-in-content.d.ts +41 -0
- package/dist/utilities/animator/content-animations/slide/slide-in-content.js +107 -0
- package/dist/utilities/animator/content-animations/slide/slide-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/slide/slide-in-content.test.js +10 -0
- package/dist/utilities/animator/content-animations/slide/slide-state-animation.d.ts +24 -0
- package/dist/utilities/animator/content-animations/slide/slide-state-animation.js +138 -0
- package/dist/utilities/animator/content-animations/slide/slide-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/slide/slide-state-animation.test.js +307 -0
- package/dist/utilities/animator/content-animations/slide/state-animation.d.ts +37 -0
- package/dist/utilities/animator/content-animations/slide/state-animation.js +170 -0
- package/dist/utilities/animator/content-animations/slide/state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/content-animations/slide/state-animation.test.js +340 -0
- package/dist/utilities/animator/index.d.ts +7 -0
- package/dist/utilities/animator/index.js +24 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-content.d.ts +18 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-content.js +37 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-content.test.js +10 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.d.ts +32 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.js +168 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.test.js +431 -0
- package/dist/utilities/animator/state-animation/slide/slide-in-content.d.ts +37 -0
- package/dist/utilities/animator/state-animation/slide/slide-in-content.js +100 -0
- package/dist/utilities/animator/state-animation/slide/slide-in-content.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/slide/slide-in-content.test.js +10 -0
- package/dist/utilities/animator/state-animation/slide/slide-state-animation.d.ts +24 -0
- package/dist/utilities/animator/state-animation/slide/slide-state-animation.js +130 -0
- package/dist/utilities/animator/state-animation/slide/slide-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/slide/slide-state-animation.test.js +301 -0
- package/dist/utilities/animator/state-animation/slide-state-animation.d.ts +24 -0
- package/dist/utilities/animator/state-animation/slide-state-animation.js +130 -0
- package/dist/utilities/animator/state-animation/slide-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/slide-state-animation.test.js +301 -0
- package/dist/utilities/animator/state-animation/state-animation.d.ts +33 -0
- package/dist/utilities/animator/state-animation/state-animation.js +146 -0
- package/dist/utilities/animator/state-animation/state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/state-animation.test.js +335 -0
- package/dist/utilities/animator/state-animation/visit-disappear-state-animation.d.ts +32 -0
- package/dist/utilities/animator/state-animation/visit-disappear-state-animation.js +168 -0
- package/dist/utilities/animator/state-animation/visit-disappear-state-animation.test.d.ts +1 -0
- package/dist/utilities/animator/state-animation/visit-disappear-state-animation.test.js +431 -0
- package/dist/utilities/data-structures/vector-set/vector-set.d.ts +7 -0
- package/dist/utilities/data-structures/vector-set/vector-set.js +26 -0
- package/dist/utilities/delta-time/delta-time.d.ts +3 -0
- package/dist/utilities/delta-time/delta-time.js +10 -0
- package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.d.ts +6 -0
- package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.js +55 -0
- package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.test.d.ts +1 -0
- package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.test.js +100 -0
- package/dist/utilities/grid-algorithms/path-finder/path-finder.d.ts +8 -0
- package/dist/utilities/grid-algorithms/path-finder/path-finder.js +98 -0
- package/dist/utilities/grid-algorithms/path-finder/path-finder.test.d.ts +1 -0
- package/dist/utilities/grid-algorithms/path-finder/path-finder.test.js +155 -0
- package/dist/utilities/grid-algorithms/position-to-grid-position-converter.d.ts +6 -0
- package/dist/utilities/grid-algorithms/position-to-grid-position-converter.js +17 -0
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.d.ts +18 -0
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.js +129 -0
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.test.d.ts +1 -0
- package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.test.js +254 -0
- package/dist/utilities/index.d.ts +6 -6
- package/dist/utilities/index.js +6 -6
- package/package.json +8 -6
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { Entity, EntityClassType } from '../entity';
|
|
2
2
|
export declare class EntityStoreHelper {
|
|
3
|
-
private static
|
|
3
|
+
private static _classIDToEntityIDToEntity;
|
|
4
4
|
static registerEntityClass(entityClass: EntityClassType): void;
|
|
5
5
|
static registerEntity(entity: Entity): void;
|
|
6
|
-
static unregisterEntity(
|
|
7
|
-
static
|
|
8
|
-
static getSingleton<T extends Entity>(EntityClass:
|
|
9
|
-
static getSingletonOrFail<T extends Entity>(EntityClass:
|
|
10
|
-
static getEntities<T extends Entity>(EntityClass:
|
|
11
|
-
static getEntityById<T extends Entity>(entityId: string, EntityClass: new (...args: any[]) => T): T | undefined;
|
|
12
|
-
private static getEntityByParsingId;
|
|
13
|
-
private static getClassNameFromEntityId;
|
|
6
|
+
static unregisterEntity(Class: EntityClassType, entityID: number): void;
|
|
7
|
+
static getEntity<T extends Entity>(Class: EntityClassType<T>, entityID: number): T | undefined;
|
|
8
|
+
static getSingleton<T extends Entity>(EntityClass: EntityClassType<T>): T | undefined;
|
|
9
|
+
static getSingletonOrFail<T extends Entity>(EntityClass: EntityClassType<T>): T;
|
|
10
|
+
static getEntities<T extends Entity>(EntityClass: EntityClassType<T>): T[];
|
|
14
11
|
}
|
|
@@ -1,81 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EntityStoreHelper = void 0;
|
|
4
|
-
const
|
|
4
|
+
const hard_reset_1 = require("../../hard-reset");
|
|
5
5
|
class EntityStoreHelper {
|
|
6
|
-
static { this.
|
|
6
|
+
static { this._classIDToEntityIDToEntity = new Map(); }
|
|
7
7
|
static registerEntityClass(entityClass) {
|
|
8
|
-
|
|
9
|
-
throw new Error(`EntityStoreHelper: Entity class names should be unique! This entity name is already taken. name: "${entityClass.name}"`);
|
|
10
|
-
}
|
|
11
|
-
else {
|
|
12
|
-
this.entities.set(entityClass.name, new Map());
|
|
13
|
-
}
|
|
8
|
+
this._classIDToEntityIDToEntity.set(entityClass.id, new Map());
|
|
14
9
|
}
|
|
15
10
|
static registerEntity(entity) {
|
|
16
|
-
let idToEntityMap = this.
|
|
11
|
+
let idToEntityMap = this._classIDToEntityIDToEntity.get(entity.classID);
|
|
17
12
|
idToEntityMap.set(entity.id, entity);
|
|
18
13
|
}
|
|
19
|
-
static unregisterEntity(
|
|
20
|
-
|
|
14
|
+
static unregisterEntity(Class, entityID) {
|
|
15
|
+
let classID = Class.id;
|
|
16
|
+
this._classIDToEntityIDToEntity.get(classID)?.delete(entityID);
|
|
21
17
|
}
|
|
22
|
-
static
|
|
23
|
-
return this.
|
|
18
|
+
static getEntity(Class, entityID) {
|
|
19
|
+
return this._classIDToEntityIDToEntity.get(Class.id)?.get(entityID);
|
|
24
20
|
}
|
|
25
21
|
static getSingleton(EntityClass) {
|
|
26
|
-
let entities = EntityStoreHelper.getEntities(EntityClass);
|
|
27
|
-
return entities[0];
|
|
28
|
-
}
|
|
29
|
-
static getSingletonOrFail(EntityClass) {
|
|
30
22
|
let entities = EntityStoreHelper.getEntities(EntityClass);
|
|
31
23
|
if (entities.length > 1) {
|
|
32
24
|
throw new Error(`EntityStoreHelper: selectSingleton is called with an entity that has multiple instances! Name: "${this.name}"`);
|
|
33
25
|
}
|
|
34
|
-
|
|
26
|
+
return entities[0];
|
|
27
|
+
}
|
|
28
|
+
static getSingletonOrFail(EntityClass) {
|
|
29
|
+
let entity = this.getSingleton(EntityClass);
|
|
30
|
+
if (!entity) {
|
|
35
31
|
throw new Error(`EntityStoreHelper: selectSingleton is called with an entity that has no instance! Name: "${this.name}"`);
|
|
36
32
|
}
|
|
37
|
-
|
|
38
|
-
return entities[0];
|
|
39
|
-
}
|
|
33
|
+
return entity;
|
|
40
34
|
}
|
|
41
35
|
static getEntities(EntityClass) {
|
|
42
|
-
let idToEntityMap = this.
|
|
43
|
-
|
|
44
|
-
return entities.filter(entity => !entity['destroyed']);
|
|
45
|
-
}
|
|
46
|
-
static getEntityById(entityId, EntityClass) {
|
|
47
|
-
let entity = this.getEntityByParsingId(entityId);
|
|
48
|
-
if (entity) {
|
|
49
|
-
if (entity instanceof EntityClass) {
|
|
50
|
-
return entity;
|
|
51
|
-
}
|
|
52
|
-
else {
|
|
53
|
-
throw new Error(`EntityStoreHelper: The given id: "${entityId}", is not belonging to the class: "${EntityClass.name}"`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
static getEntityByParsingId(entityId) {
|
|
58
|
-
try {
|
|
59
|
-
let className = this.getClassNameFromEntityId(entityId);
|
|
60
|
-
return this.entities.get(className)?.get(entityId);
|
|
61
|
-
}
|
|
62
|
-
catch {
|
|
63
|
-
throw new Error(`EntityStoreHelper.getEntityByIdWithoutType(): invalid entity id: "${entityId}"`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
static getClassNameFromEntityId(entityId) {
|
|
67
|
-
if (!entityId) {
|
|
68
|
-
throw new Error(`EntityStoreHelper: getClassNameFromEntityId called with no id: "${entityId}"`);
|
|
69
|
-
}
|
|
70
|
-
let index = entityId.indexOf(':');
|
|
71
|
-
if (index === -1) {
|
|
72
|
-
throw new Error(`EntityStoreHelper: invalid entity id: "${entityId}"`);
|
|
73
|
-
}
|
|
74
|
-
return entityId.substring(0, index);
|
|
36
|
+
let idToEntityMap = this._classIDToEntityIDToEntity.get(EntityClass.id);
|
|
37
|
+
return Array.from(idToEntityMap.values());
|
|
75
38
|
}
|
|
76
39
|
}
|
|
77
40
|
exports.EntityStoreHelper = EntityStoreHelper;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
41
|
+
hard_reset_1.BardLegendsHardReset.onHardReset
|
|
42
|
+
.subscribe(() => {
|
|
43
|
+
EntityStoreHelper['_classIDToEntityIDToEntity'].clear();
|
|
44
|
+
})
|
|
45
|
+
.attachToRoot();
|
|
81
46
|
//# sourceMappingURL=entity-store.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const vitest_1 = require("vitest");
|
|
10
|
+
const hard_reset_1 = require("../../hard-reset");
|
|
11
|
+
const entity_1 = require("../entity");
|
|
12
|
+
const singleton_entity_1 = require("../singleton-entity");
|
|
13
|
+
const entity_store_helper_1 = require("./entity-store.helper");
|
|
14
|
+
(0, vitest_1.describe)('EntityStoreHelper', () => {
|
|
15
|
+
(0, vitest_1.beforeEach)(() => {
|
|
16
|
+
hard_reset_1.BardLegendsHardReset.hardReset();
|
|
17
|
+
});
|
|
18
|
+
(0, vitest_1.describe)('registering entity class', () => {
|
|
19
|
+
(0, vitest_1.test)('should register entity class', () => {
|
|
20
|
+
let Sample = class Sample extends entity_1.Entity {
|
|
21
|
+
};
|
|
22
|
+
Sample = __decorate([
|
|
23
|
+
(0, entity_1.EntityDecorator)()
|
|
24
|
+
], Sample);
|
|
25
|
+
entity_store_helper_1.EntityStoreHelper.registerEntityClass(Sample);
|
|
26
|
+
let classID = Sample.id;
|
|
27
|
+
(0, vitest_1.expect)(classID).toBeDefined();
|
|
28
|
+
if (classID) {
|
|
29
|
+
(0, vitest_1.expect)(entity_store_helper_1.EntityStoreHelper['_classIDToEntityIDToEntity'].get(classID)).toBeDefined();
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
(0, vitest_1.test)('should register entity class with different class ids', () => {
|
|
33
|
+
let Sample1 = class Sample1 extends entity_1.Entity {
|
|
34
|
+
};
|
|
35
|
+
Sample1 = __decorate([
|
|
36
|
+
(0, entity_1.EntityDecorator)()
|
|
37
|
+
], Sample1);
|
|
38
|
+
let Sample2 = class Sample2 extends entity_1.Entity {
|
|
39
|
+
};
|
|
40
|
+
Sample2 = __decorate([
|
|
41
|
+
(0, entity_1.EntityDecorator)()
|
|
42
|
+
], Sample2);
|
|
43
|
+
entity_store_helper_1.EntityStoreHelper.registerEntityClass(Sample1);
|
|
44
|
+
entity_store_helper_1.EntityStoreHelper.registerEntityClass(Sample2);
|
|
45
|
+
let classID1 = entity_store_helper_1.EntityStoreHelper['_classIDToEntityIDToEntity'].get(Sample1.id);
|
|
46
|
+
let classID2 = entity_store_helper_1.EntityStoreHelper['_classIDToEntityIDToEntity'].get(Sample2.id);
|
|
47
|
+
(0, vitest_1.expect)(classID1).toBeDefined();
|
|
48
|
+
(0, vitest_1.expect)(classID2).toBeDefined();
|
|
49
|
+
(0, vitest_1.expect)(classID1).not.toBe(classID2);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
(0, vitest_1.describe)('crud operations on entity', () => {
|
|
53
|
+
(0, vitest_1.test)('register entity', () => {
|
|
54
|
+
let Sample = class Sample extends entity_1.Entity {
|
|
55
|
+
};
|
|
56
|
+
Sample = __decorate([
|
|
57
|
+
(0, entity_1.EntityDecorator)()
|
|
58
|
+
], Sample);
|
|
59
|
+
let entity = new Sample().attachToRoot();
|
|
60
|
+
entity_store_helper_1.EntityStoreHelper.registerEntity(entity);
|
|
61
|
+
(0, vitest_1.expect)(entity_store_helper_1.EntityStoreHelper.getEntity(Sample, entity.id)).toBeDefined();
|
|
62
|
+
});
|
|
63
|
+
(0, vitest_1.test)('unregister entity', () => {
|
|
64
|
+
let Sample = class Sample extends entity_1.Entity {
|
|
65
|
+
};
|
|
66
|
+
Sample = __decorate([
|
|
67
|
+
(0, entity_1.EntityDecorator)()
|
|
68
|
+
], Sample);
|
|
69
|
+
let entity = new Sample().attachToRoot();
|
|
70
|
+
entity_store_helper_1.EntityStoreHelper.registerEntity(entity);
|
|
71
|
+
entity_store_helper_1.EntityStoreHelper.unregisterEntity(Sample, entity.id);
|
|
72
|
+
(0, vitest_1.expect)(entity_store_helper_1.EntityStoreHelper.getEntity(Sample, entity.id)).toBeUndefined();
|
|
73
|
+
});
|
|
74
|
+
(0, vitest_1.test)('get entity', () => {
|
|
75
|
+
let Sample = class Sample extends entity_1.Entity {
|
|
76
|
+
};
|
|
77
|
+
Sample = __decorate([
|
|
78
|
+
(0, entity_1.EntityDecorator)()
|
|
79
|
+
], Sample);
|
|
80
|
+
let entity = new Sample().attachToRoot();
|
|
81
|
+
entity_store_helper_1.EntityStoreHelper.registerEntity(entity);
|
|
82
|
+
(0, vitest_1.expect)(entity_store_helper_1.EntityStoreHelper.getEntity(Sample, entity.id)).toBe(entity);
|
|
83
|
+
});
|
|
84
|
+
(0, vitest_1.test)('get entities', () => {
|
|
85
|
+
let Sample = class Sample extends entity_1.Entity {
|
|
86
|
+
};
|
|
87
|
+
Sample = __decorate([
|
|
88
|
+
(0, entity_1.EntityDecorator)()
|
|
89
|
+
], Sample);
|
|
90
|
+
let entity1 = new Sample().attachToRoot();
|
|
91
|
+
let entity2 = new Sample().attachToRoot();
|
|
92
|
+
entity_store_helper_1.EntityStoreHelper.registerEntity(entity1);
|
|
93
|
+
entity_store_helper_1.EntityStoreHelper.registerEntity(entity2);
|
|
94
|
+
(0, vitest_1.expect)(entity_store_helper_1.EntityStoreHelper.getEntities(Sample)).toEqual([entity1, entity2]);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
(0, vitest_1.describe)('singleton operations', () => {
|
|
98
|
+
(0, vitest_1.test)('get singleton with success', () => {
|
|
99
|
+
let Sample = class Sample extends singleton_entity_1.SingletonEntity {
|
|
100
|
+
};
|
|
101
|
+
Sample = __decorate([
|
|
102
|
+
(0, entity_1.EntityDecorator)()
|
|
103
|
+
], Sample);
|
|
104
|
+
let entity = new Sample().attachToRoot();
|
|
105
|
+
entity_store_helper_1.EntityStoreHelper.registerEntity(entity);
|
|
106
|
+
(0, vitest_1.expect)(entity_store_helper_1.EntityStoreHelper.getSingleton(Sample)).toBe(entity);
|
|
107
|
+
});
|
|
108
|
+
(0, vitest_1.test)('get singleton with error', () => {
|
|
109
|
+
let Sample = class Sample extends singleton_entity_1.SingletonEntity {
|
|
110
|
+
};
|
|
111
|
+
Sample = __decorate([
|
|
112
|
+
(0, entity_1.EntityDecorator)()
|
|
113
|
+
], Sample);
|
|
114
|
+
(0, vitest_1.expect)(entity_store_helper_1.EntityStoreHelper.getSingleton(Sample)).toBeUndefined();
|
|
115
|
+
});
|
|
116
|
+
(0, vitest_1.test)('get singleton or fail with success', () => {
|
|
117
|
+
let Sample = class Sample extends singleton_entity_1.SingletonEntity {
|
|
118
|
+
};
|
|
119
|
+
Sample = __decorate([
|
|
120
|
+
(0, entity_1.EntityDecorator)()
|
|
121
|
+
], Sample);
|
|
122
|
+
let entity = new Sample().attachToRoot();
|
|
123
|
+
entity_store_helper_1.EntityStoreHelper.registerEntity(entity);
|
|
124
|
+
(0, vitest_1.expect)(entity_store_helper_1.EntityStoreHelper.getSingletonOrFail(Sample)).toBe(entity);
|
|
125
|
+
});
|
|
126
|
+
(0, vitest_1.test)('get singleton or fail with error', () => {
|
|
127
|
+
let Sample = class Sample extends singleton_entity_1.SingletonEntity {
|
|
128
|
+
};
|
|
129
|
+
Sample = __decorate([
|
|
130
|
+
(0, entity_1.EntityDecorator)()
|
|
131
|
+
], Sample);
|
|
132
|
+
(0, vitest_1.expect)(() => entity_store_helper_1.EntityStoreHelper.getSingletonOrFail(Sample)).toThrow();
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
//# sourceMappingURL=entity-store.helper.test.js.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ViewClassType } from '../../view/view';
|
|
2
2
|
import { Entity, EntityClassType } from '../entity';
|
|
3
3
|
export declare class EntityViewsHelper {
|
|
4
|
-
private
|
|
5
|
-
private static
|
|
6
|
-
static
|
|
7
|
-
static registerView<T>(ViewClass: ViewClassType<T>, EntityClass: EntityClassType): void;
|
|
8
|
-
private static
|
|
9
|
-
private
|
|
10
|
-
constructor(
|
|
4
|
+
private _entity;
|
|
5
|
+
private static _viewRegistries;
|
|
6
|
+
static entityID: number;
|
|
7
|
+
static registerView<T extends Entity>(ViewClass: ViewClassType<T>, EntityClass: EntityClassType<T>): void;
|
|
8
|
+
private static _createView;
|
|
9
|
+
private _views;
|
|
10
|
+
constructor(_entity: Entity);
|
|
11
11
|
createViews(): void;
|
|
12
12
|
updateViews(time: number, delta: number): void;
|
|
13
13
|
destroyViews(): void;
|
|
@@ -1,66 +1,71 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EntityViewsHelper = void 0;
|
|
4
|
+
const hard_reset_1 = require("../../hard-reset");
|
|
4
5
|
const service_1 = require("../../service/service");
|
|
5
|
-
const update_cycle_1 = require("../../update-cycle");
|
|
6
6
|
const entity_store_helper_1 = require("./entity-store.helper");
|
|
7
7
|
class EntityViewsHelper {
|
|
8
|
-
static { this.
|
|
8
|
+
static { this._viewRegistries = new Map(); }
|
|
9
9
|
static registerView(ViewClass, EntityClass) {
|
|
10
|
-
if (!EntityViewsHelper.
|
|
11
|
-
EntityViewsHelper.
|
|
10
|
+
if (!EntityViewsHelper._viewRegistries.has(EntityClass)) {
|
|
11
|
+
EntityViewsHelper._viewRegistries.set(EntityClass, []);
|
|
12
12
|
}
|
|
13
|
-
let relatedRegistries = EntityViewsHelper.
|
|
13
|
+
let relatedRegistries = EntityViewsHelper._viewRegistries.get(EntityClass);
|
|
14
14
|
relatedRegistries && relatedRegistries.push(ViewClass);
|
|
15
15
|
let alreadyCreatedEntities = entity_store_helper_1.EntityStoreHelper.getEntities(EntityClass);
|
|
16
16
|
alreadyCreatedEntities.forEach(entity => {
|
|
17
|
-
this.
|
|
17
|
+
this._createView(entity, ViewClass);
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
static
|
|
20
|
+
static _createView(entity, ViewClass) {
|
|
21
21
|
try {
|
|
22
|
-
let resolvedViewArgs = service_1.Service.
|
|
23
|
-
EntityViewsHelper.
|
|
22
|
+
let resolvedViewArgs = service_1.Service._resolveParameters([this], ViewClass.$meta.paramtypes);
|
|
23
|
+
EntityViewsHelper.entityID = entity.id;
|
|
24
24
|
let view = new ViewClass(entity, ...resolvedViewArgs.slice(1));
|
|
25
25
|
if (entity.destroyed) {
|
|
26
26
|
// Created view might destroy its entity in constructor, which should also destroy the view
|
|
27
27
|
view.destroy();
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
|
-
entity
|
|
30
|
+
entity._viewCreationHelper._views.push(view);
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
catch (e) {
|
|
34
34
|
console.error(e);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
constructor(
|
|
38
|
-
this.
|
|
39
|
-
this.
|
|
37
|
+
constructor(_entity) {
|
|
38
|
+
this._entity = _entity;
|
|
39
|
+
this._views = [];
|
|
40
40
|
}
|
|
41
41
|
createViews() {
|
|
42
|
-
if (!this.
|
|
43
|
-
let registeredViewClasses = EntityViewsHelper.
|
|
42
|
+
if (!this._entity.destroyed) {
|
|
43
|
+
let registeredViewClasses = EntityViewsHelper._viewRegistries.get(this._entity.constructor);
|
|
44
44
|
if (registeredViewClasses) {
|
|
45
45
|
registeredViewClasses.forEach(ViewClass => {
|
|
46
|
-
EntityViewsHelper.
|
|
46
|
+
EntityViewsHelper._createView(this._entity, ViewClass);
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
updateViews(time, delta) {
|
|
52
|
-
this.
|
|
53
|
-
view.
|
|
54
|
-
|
|
52
|
+
for (let i = 0; i < this._views.length; i++) {
|
|
53
|
+
let view = this._views[i];
|
|
54
|
+
if (!view.destroyed) {
|
|
55
|
+
view.update(time, delta);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
55
58
|
}
|
|
56
59
|
destroyViews() {
|
|
57
|
-
this.
|
|
60
|
+
this._views.forEach(view => {
|
|
58
61
|
view.destroy();
|
|
59
62
|
});
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
exports.EntityViewsHelper = EntityViewsHelper;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
hard_reset_1.BardLegendsHardReset.onHardReset
|
|
67
|
+
.subscribe(() => {
|
|
68
|
+
EntityViewsHelper['_viewRegistries'] = new Map();
|
|
69
|
+
})
|
|
70
|
+
.attachToRoot();
|
|
66
71
|
//# sourceMappingURL=entity-views.helper.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Entity } from './entity';
|
|
1
|
+
import { Entity, EntityClassType } from './entity';
|
|
2
2
|
export declare abstract class SingletonEntity extends Entity {
|
|
3
|
-
static getInstance<T extends SingletonEntity>(this:
|
|
4
|
-
static getInstanceOrFail<T extends SingletonEntity>(this:
|
|
3
|
+
static getInstance<T extends SingletonEntity>(this: EntityClassType<T>): T | undefined;
|
|
4
|
+
static getInstanceOrFail<T extends SingletonEntity>(this: EntityClassType<T>): T;
|
|
5
5
|
constructor();
|
|
6
6
|
}
|
|
@@ -15,7 +15,7 @@ class SingletonEntity extends entity_1.Entity {
|
|
|
15
15
|
let entities = this.constructor.getEntities();
|
|
16
16
|
if (entities.length > 1) {
|
|
17
17
|
this.attachToRoot();
|
|
18
|
-
throw new Error(`SingletonEntity: entity is decorated as singleton but multiple instances are created!
|
|
18
|
+
throw new Error(`SingletonEntity: entity is decorated as singleton but multiple instances are created! "${this}"`);
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
}
|
|
@@ -1,49 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
2
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
3
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
4
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
22
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
7
|
};
|
|
24
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
25
|
-
if (mod && mod.__esModule) return mod;
|
|
26
|
-
var result = {};
|
|
27
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
28
|
-
__setModuleDefault(result, mod);
|
|
29
|
-
return result;
|
|
30
|
-
};
|
|
31
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
32
|
-
const
|
|
9
|
+
const actions_lib_1 = require("actions-lib");
|
|
33
10
|
const vitest_1 = require("vitest");
|
|
34
|
-
const
|
|
11
|
+
const hard_reset_1 = require("../hard-reset");
|
|
35
12
|
const scene_1 = require("../scene/scene");
|
|
36
|
-
const update_cycle_1 = require("../update-cycle");
|
|
37
13
|
const entity_1 = require("./entity");
|
|
38
14
|
const singleton_entity_1 = require("./singleton-entity");
|
|
39
|
-
decorate_actions_lib_1.ActionsLibDecorator.decorate(ActionsLib);
|
|
40
15
|
(0, vitest_1.describe)('SINGLETON ENTITY', () => {
|
|
41
16
|
(0, vitest_1.beforeEach)(() => {
|
|
42
|
-
|
|
17
|
+
hard_reset_1.BardLegendsHardReset.hardReset();
|
|
43
18
|
let SampleScene = class SampleScene extends scene_1.Scene {
|
|
44
|
-
|
|
19
|
+
init() {
|
|
20
|
+
return actions_lib_1.SingleEvent.instant();
|
|
21
|
+
}
|
|
45
22
|
update() { }
|
|
46
|
-
|
|
23
|
+
prepareToClose() {
|
|
24
|
+
return actions_lib_1.SingleEvent.instant();
|
|
25
|
+
}
|
|
47
26
|
};
|
|
48
27
|
SampleScene = __decorate([
|
|
49
28
|
(0, scene_1.SceneDecorator)()
|
|
@@ -83,6 +62,5 @@ decorate_actions_lib_1.ActionsLibDecorator.decorate(ActionsLib);
|
|
|
83
62
|
new Sample().attach(baseEntity);
|
|
84
63
|
(0, vitest_1.expect)(() => new Sample()).toThrow();
|
|
85
64
|
});
|
|
86
|
-
// TODO: test continuesSubscription
|
|
87
65
|
});
|
|
88
66
|
//# sourceMappingURL=singleton-entity.test.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BardLegendsHardReset = void 0;
|
|
4
|
+
const actions_lib_1 = require("actions-lib");
|
|
5
|
+
class BardLegendsHardReset {
|
|
6
|
+
static { this._hardResetAction = new actions_lib_1.Action(); }
|
|
7
|
+
static { this.onHardReset = this._hardResetAction.notifier; }
|
|
8
|
+
static hardReset() {
|
|
9
|
+
actions_lib_1.ActionLib.hardReset();
|
|
10
|
+
this._hardResetAction.trigger();
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.BardLegendsHardReset = BardLegendsHardReset;
|
|
14
|
+
//# sourceMappingURL=hard-reset.js.map
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
export { Attachable } from './base/attachable';
|
|
2
|
-
export { ActionsLibDecorator } from './base/helpers/decorate-actions-lib';
|
|
3
|
-
export { ReferanceVariable } from './base/helpers/referance-variable';
|
|
4
1
|
export { ControllerDecorator, ControllerDecoratorMeta, ControllerLink } from './controller/controller';
|
|
5
2
|
export { Entity, EntityDecorator } from './entity/entity';
|
|
6
3
|
export { SingletonEntity } from './entity/singleton-entity';
|
|
4
|
+
export { BardLegendsHardReset } from './hard-reset';
|
|
7
5
|
export { Scene, SceneDecorator } from './scene/scene';
|
|
8
6
|
export { Service, ServiceDecorator } from './service/service';
|
|
9
7
|
export { UpdateCycle } from './update-cycle';
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ViewDecorator = exports.View = exports.UpdateCycle = exports.ServiceDecorator = exports.Service = exports.SceneDecorator = exports.Scene = exports.SingletonEntity = exports.EntityDecorator = exports.Entity = exports.ControllerLink = exports.ControllerDecorator =
|
|
4
|
-
var attachable_1 = require("./base/attachable");
|
|
5
|
-
Object.defineProperty(exports, "Attachable", { enumerable: true, get: function () { return attachable_1.Attachable; } });
|
|
6
|
-
var decorate_actions_lib_1 = require("./base/helpers/decorate-actions-lib");
|
|
7
|
-
Object.defineProperty(exports, "ActionsLibDecorator", { enumerable: true, get: function () { return decorate_actions_lib_1.ActionsLibDecorator; } });
|
|
8
|
-
var referance_variable_1 = require("./base/helpers/referance-variable");
|
|
9
|
-
Object.defineProperty(exports, "ReferanceVariable", { enumerable: true, get: function () { return referance_variable_1.ReferanceVariable; } });
|
|
3
|
+
exports.ViewDecorator = exports.View = exports.UpdateCycle = exports.ServiceDecorator = exports.Service = exports.SceneDecorator = exports.Scene = exports.BardLegendsHardReset = exports.SingletonEntity = exports.EntityDecorator = exports.Entity = exports.ControllerLink = exports.ControllerDecorator = void 0;
|
|
10
4
|
var controller_1 = require("./controller/controller");
|
|
11
5
|
Object.defineProperty(exports, "ControllerDecorator", { enumerable: true, get: function () { return controller_1.ControllerDecorator; } });
|
|
12
6
|
Object.defineProperty(exports, "ControllerLink", { enumerable: true, get: function () { return controller_1.ControllerLink; } });
|
|
@@ -15,6 +9,8 @@ Object.defineProperty(exports, "Entity", { enumerable: true, get: function () {
|
|
|
15
9
|
Object.defineProperty(exports, "EntityDecorator", { enumerable: true, get: function () { return entity_1.EntityDecorator; } });
|
|
16
10
|
var singleton_entity_1 = require("./entity/singleton-entity");
|
|
17
11
|
Object.defineProperty(exports, "SingletonEntity", { enumerable: true, get: function () { return singleton_entity_1.SingletonEntity; } });
|
|
12
|
+
var hard_reset_1 = require("./hard-reset");
|
|
13
|
+
Object.defineProperty(exports, "BardLegendsHardReset", { enumerable: true, get: function () { return hard_reset_1.BardLegendsHardReset; } });
|
|
18
14
|
var scene_1 = require("./scene/scene");
|
|
19
15
|
Object.defineProperty(exports, "Scene", { enumerable: true, get: function () { return scene_1.Scene; } });
|
|
20
16
|
Object.defineProperty(exports, "SceneDecorator", { enumerable: true, get: function () { return scene_1.SceneDecorator; } });
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Attachable } from '../base/attachable';
|
|
1
|
+
import { IDAttachable, SingleEvent } from 'actions-lib';
|
|
3
2
|
export type SceneClassType = new (...services: unknown[]) => Scene<unknown, unknown>;
|
|
4
3
|
type SceneInput<T> = T extends Scene<infer I, any> ? I : never;
|
|
5
|
-
type SceneOutput<T> = T extends Scene<any, infer O> ? O : never;
|
|
6
4
|
export declare function SceneDecorator(): (SceneClass: SceneClassType) => any;
|
|
7
|
-
export declare abstract class Scene<InputType, OutputType> extends
|
|
8
|
-
private static
|
|
9
|
-
static
|
|
5
|
+
export declare abstract class Scene<InputType, OutputType> extends IDAttachable {
|
|
6
|
+
private static _sceneTransitioning;
|
|
7
|
+
private static readonly _activeScene;
|
|
8
|
+
static readonly activeScene: import("actions-lib").Notifier<Scene<unknown, unknown> | undefined>;
|
|
10
9
|
static getActiveScene(this: typeof Scene): Scene<unknown, unknown> | undefined;
|
|
11
10
|
static getActiveSceneOrFail(this: typeof Scene): Scene<unknown, unknown>;
|
|
12
11
|
static isActive<T extends Scene<unknown, unknown>>(this: new (...args: unknown[]) => T): boolean;
|
|
13
12
|
static getInstance<T extends Scene<unknown, unknown>>(this: new (...args: unknown[]) => T): T | undefined;
|
|
14
13
|
static getInstanceOrFail<T extends Scene<unknown, unknown>>(this: new (...args: unknown[]) => T): T;
|
|
15
|
-
static open<T extends Scene<any, any>>(this: new (...
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
private closePromise;
|
|
20
|
-
private resolveClosePromise;
|
|
14
|
+
static open<T extends Scene<any, any>>(this: new (...args1: unknown[]) => T, ...args2: T extends Scene<void, any> ? [] : [SceneInput<T>]): SingleEvent<T>;
|
|
15
|
+
private readonly _onClose;
|
|
16
|
+
readonly onClose: import("actions-lib").Notifier<OutputType>;
|
|
21
17
|
constructor();
|
|
22
|
-
close(...args: OutputType extends void ? [] : [OutputType]):
|
|
23
|
-
protected abstract init(input: InputType):
|
|
18
|
+
close(...args: OutputType extends void ? [] : [OutputType]): SingleEvent<OutputType>;
|
|
19
|
+
protected abstract init(input: InputType): SingleEvent;
|
|
24
20
|
protected abstract update(time: number, delta: number): void;
|
|
25
|
-
protected abstract prepareToClose():
|
|
21
|
+
protected abstract prepareToClose(): SingleEvent;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated
|
|
24
|
+
*/
|
|
25
|
+
destroy(): void;
|
|
26
26
|
}
|
|
27
27
|
export {};
|