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.
Files changed (288) hide show
  1. package/dist/actions-performance.test.d.ts +1 -0
  2. package/dist/actions-performance.test.js +83 -0
  3. package/dist/game-entities/controller/controller.d.ts +2 -3
  4. package/dist/game-entities/controller/controller.js +9 -8
  5. package/dist/game-entities/controller/controller.test.js +2 -2
  6. package/dist/game-entities/entity/entity.d.ts +11 -9
  7. package/dist/game-entities/entity/entity.js +20 -16
  8. package/dist/game-entities/entity/entity.test.js +116 -147
  9. package/dist/game-entities/entity/helpers/entity-store.helper.d.ts +6 -9
  10. package/dist/game-entities/entity/helpers/entity-store.helper.js +22 -57
  11. package/dist/game-entities/entity/helpers/entity-store.helper.test.d.ts +1 -0
  12. package/dist/game-entities/entity/helpers/entity-store.helper.test.js +136 -0
  13. package/dist/game-entities/entity/helpers/entity-views.helper.d.ts +7 -7
  14. package/dist/game-entities/entity/helpers/entity-views.helper.js +28 -23
  15. package/dist/game-entities/entity/singleton-entity.d.ts +3 -3
  16. package/dist/game-entities/entity/singleton-entity.js +1 -1
  17. package/dist/game-entities/entity/singleton-entity.test.js +9 -31
  18. package/dist/game-entities/hard-reset.d.ts +5 -0
  19. package/dist/game-entities/hard-reset.js +14 -0
  20. package/dist/game-entities/index.d.ts +1 -3
  21. package/dist/game-entities/index.js +3 -7
  22. package/dist/game-entities/scene/scene.d.ts +15 -15
  23. package/dist/game-entities/scene/scene.js +61 -60
  24. package/dist/game-entities/scene/scene.test.js +97 -67
  25. package/dist/game-entities/service/service.d.ts +1 -4
  26. package/dist/game-entities/service/service.js +15 -14
  27. package/dist/game-entities/service/service.test.js +33 -38
  28. package/dist/game-entities/unit-test.helper.d.ts +5 -0
  29. package/dist/game-entities/unit-test.helper.js +14 -0
  30. package/dist/game-entities/update-cycle.d.ts +10 -9
  31. package/dist/game-entities/update-cycle.js +34 -23
  32. package/dist/game-entities/view/view.d.ts +10 -11
  33. package/dist/game-entities/view/view.js +17 -35
  34. package/dist/game-entities/view/view.test.js +73 -250
  35. package/dist/physics/entity-types/immovable-physics-entity.d.ts +2 -4
  36. package/dist/physics/entity-types/immovable-physics-entity.js +4 -6
  37. package/dist/physics/entity-types/movable-entity.d.ts +1 -1
  38. package/dist/physics/entity-types/movable-entity.js +6 -6
  39. package/dist/physics/entity-types/movable-physics-entity.d.ts +10 -11
  40. package/dist/physics/entity-types/movable-physics-entity.js +31 -32
  41. package/dist/physics/entity-types/physics-entity.d.ts +12 -15
  42. package/dist/physics/entity-types/physics-entity.js +30 -28
  43. package/dist/physics/interfaces.d.ts +6 -6
  44. package/dist/physics/interfaces.js +4 -4
  45. package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics-internal.controller.d.ts +16 -16
  46. package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics-internal.controller.js +22 -22
  47. package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics.controller.d.ts +20 -20
  48. package/dist/physics/module//342/232/234/357/270/217gateways/controllers/physics.controller.js +30 -30
  49. package/dist/physics/module//342/232/234/357/270/217gateways/dtos/requests.dto.d.ts +3 -3
  50. package/dist/physics/module//342/232/234/357/270/217gateways/physics-internal.gateway.d.ts +10 -10
  51. package/dist/physics/module//342/232/234/357/270/217gateways/physics-internal.gateway.js +16 -16
  52. package/dist/physics/module//342/232/234/357/270/217gateways/physics.gateway.d.ts +11 -11
  53. package/dist/physics/module//342/232/234/357/270/217gateways/physics.gateway.js +18 -18
  54. package/dist/physics/module//360/237/223/220services/collision/collisions.service.d.ts +5 -5
  55. package/dist/physics/module//360/237/223/220services/collision/collisions.service.js +17 -17
  56. package/dist/physics/module//360/237/223/220services/collision/hit-test.service.d.ts +4 -4
  57. package/dist/physics/module//360/237/223/220services/collision/hit-test.service.js +11 -11
  58. package/dist/physics/module//360/237/223/220services/collision/physics-body-group.service.d.ts +2 -2
  59. package/dist/physics/module//360/237/223/220services/collision/physics-body-group.service.js +4 -4
  60. package/dist/physics/module//360/237/223/220services/creation/border.service.d.ts +2 -2
  61. package/dist/physics/module//360/237/223/220services/creation/border.service.js +9 -9
  62. package/dist/physics/module//360/237/223/220services/creation/materials.service.d.ts +7 -7
  63. package/dist/physics/module//360/237/223/220services/creation/materials.service.js +17 -17
  64. package/dist/physics/module//360/237/223/220services/creation/physics-world.service.d.ts +11 -11
  65. package/dist/physics/module//360/237/223/220services/creation/physics-world.service.js +28 -27
  66. package/dist/physics/module//360/237/223/220services/creation/shape-creation.service.d.ts +4 -4
  67. package/dist/physics/module//360/237/223/220services/creation/shape-creation.service.js +13 -13
  68. package/dist/physics/module//360/237/223/220services/impact/eliptic-explosion.service.d.ts +9 -9
  69. package/dist/physics/module//360/237/223/220services/impact/eliptic-explosion.service.js +19 -19
  70. package/dist/physics/module//360/237/223/220services/impact/explosion.service.d.ts +9 -9
  71. package/dist/physics/module//360/237/223/220services/impact/explosion.service.js +20 -20
  72. package/dist/physics/module//360/237/223/220services/impact/ray-cast-hit-converter.d.ts +1 -1
  73. package/dist/physics/module//360/237/223/220services/impact/ray-cast-hit-converter.js +4 -4
  74. package/dist/physics/module//360/237/223/220services/path-finding/availability-grid-cache.service.d.ts +2 -2
  75. package/dist/physics/module//360/237/223/220services/path-finding/availability-grid-cache.service.js +3 -3
  76. package/dist/physics/module//360/237/223/220services/path-finding/availability-grid.service.d.ts +5 -5
  77. package/dist/physics/module//360/237/223/220services/path-finding/availability-grid.service.js +13 -13
  78. package/dist/physics/module//360/237/223/220services/path-finding/path-finder.service.d.ts +4 -4
  79. package/dist/physics/module//360/237/223/220services/path-finding/path-finder.service.js +13 -13
  80. package/dist/physics/module//360/237/223/220services/query/physics-query.service.d.ts +4 -4
  81. package/dist/physics/module//360/237/223/220services/query/physics-query.service.js +4 -4
  82. package/dist/physics/module//360/237/223/220services/ray-casting/ray-casting.service.d.ts +1 -4
  83. package/dist/physics/module//360/237/223/220services/ray-casting/ray-casting.service.js +7 -15
  84. package/dist/physics/module//360/237/223/220services/test-visuals/test-visuals.service.d.ts +9 -9
  85. package/dist/physics/module//360/237/223/220services/test-visuals/test-visuals.service.js +60 -49
  86. package/dist/physics/module//360/237/247/212entities/border.entity.d.ts +1 -1
  87. package/dist/physics/module//360/237/247/212entities/border.entity.js +3 -3
  88. package/dist/physics/module//360/237/247/212entities/physics-world.entity.js +2 -2
  89. package/dist/pixi/components/display-object-array.d.ts +5 -5
  90. package/dist/pixi/components/display-object-array.js +14 -14
  91. package/dist/pixi/components/helpers/smooth-scroller.d.ts +7 -7
  92. package/dist/pixi/components/helpers/smooth-scroller.js +23 -23
  93. package/dist/pixi/components/helpers/smooth-scroller.test.js +14 -14
  94. package/dist/pixi/components/menu/menu-entity.d.ts +14 -0
  95. package/dist/pixi/components/menu/menu-entity.js +48 -0
  96. package/dist/pixi/components/menu/menu.ui.d.ts +23 -0
  97. package/dist/pixi/components/menu/menu.ui.js +97 -0
  98. package/dist/pixi/components/mouse-wheel-listener.ui.d.ts +4 -3
  99. package/dist/pixi/components/mouse-wheel-listener.ui.js +15 -14
  100. package/dist/pixi/components/scroll-area.ui.d.ts +1 -1
  101. package/dist/pixi/components/scroll-area.ui.js +9 -9
  102. package/dist/pixi/components/scroll-mask.ui.d.ts +9 -8
  103. package/dist/pixi/components/scroll-mask.ui.js +25 -24
  104. package/dist/pixi/display-object/container-attributes.d.ts +24 -26
  105. package/dist/pixi/display-object/container-attributes.js +27 -28
  106. package/dist/pixi/display-object/container.d.ts +3 -6
  107. package/dist/pixi/display-object/container.js +2 -12
  108. package/dist/pixi/display-object/filters/base-filters/blur.filter.d.ts +9 -9
  109. package/dist/pixi/display-object/filters/base-filters/blur.filter.js +25 -25
  110. package/dist/pixi/display-object/filters/base-filters/expand-with-color.filter.d.ts +7 -7
  111. package/dist/pixi/display-object/filters/base-filters/expand-with-color.filter.js +17 -17
  112. package/dist/pixi/display-object/filters/composite-filters/glow-filter.d.ts +6 -6
  113. package/dist/pixi/display-object/filters/composite-filters/glow-filter.js +10 -11
  114. package/dist/pixi/display-object/filters/helpers/gaussian-values.helper.d.ts +2 -2
  115. package/dist/pixi/display-object/filters/helpers/gaussian-values.helper.js +5 -5
  116. package/dist/pixi/display-object/filters/templates/checking-neighbors.template.d.ts +5 -5
  117. package/dist/pixi/display-object/filters/templates/checking-neighbors.template.js +8 -8
  118. package/dist/pixi/display-object/filters/templates/plane.template.d.ts +5 -5
  119. package/dist/pixi/display-object/filters/templates/plane.template.js +7 -7
  120. package/dist/pixi/display-object/filters.d.ts +7 -7
  121. package/dist/pixi/display-object/filters.js +34 -34
  122. package/dist/pixi/display-object/index.d.ts +1 -1
  123. package/dist/pixi/display-object/objects/graphics/graphics.d.ts +9 -9
  124. package/dist/pixi/display-object/objects/graphics/graphics.js +25 -25
  125. package/dist/pixi/display-object/objects/placeholder.d.ts +1 -1
  126. package/dist/pixi/display-object/objects/placeholder.js +7 -7
  127. package/dist/pixi/display-object/objects/sprite/glow-sprite-generator.d.ts +9 -9
  128. package/dist/pixi/display-object/objects/sprite/glow-sprite-generator.js +29 -26
  129. package/dist/pixi/display-object/objects/sprite/sprite.d.ts +10 -9
  130. package/dist/pixi/display-object/objects/sprite/sprite.js +62 -53
  131. package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/pixi-text-style-converter.d.ts +4 -3
  132. package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.d.ts +6 -6
  133. package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.js +16 -16
  134. package/dist/pixi/display-object/objects/text/helpers/process-steps/1-data-in-converter/rich-text-data-in-converter.test.js +28 -28
  135. package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/consistent-space-text-wrapper.d.ts +1 -1
  136. package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/consistent-space-text-wrapper.js +3 -3
  137. package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/rich-text-typewriter.d.ts +17 -17
  138. package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/rich-text-typewriter.js +62 -62
  139. package/dist/pixi/display-object/objects/text/helpers/process-steps/2-wrapping-text/rich-text-typewriter.test.js +2 -2
  140. package/dist/pixi/display-object/objects/text/helpers/process-steps/3-data-out-converter/rich-text-data-out-converter.d.ts +3 -3
  141. package/dist/pixi/display-object/objects/text/helpers/process-steps/3-data-out-converter/rich-text-data-out-converter.js +6 -6
  142. package/dist/pixi/display-object/objects/text/helpers/process-steps/3-data-out-converter/rich-text-data-out-converter.test.js +12 -12
  143. package/dist/pixi/display-object/objects/text/helpers/rich-text-to-plane-text.d.ts +2 -2
  144. package/dist/pixi/display-object/objects/text/helpers/rich-text-to-plane-text.test.js +5 -5
  145. package/dist/pixi/display-object/objects/text/rich-text.d.ts +0 -1
  146. package/dist/pixi/display-object/objects/text/rich-text.js +0 -1
  147. package/dist/pixi/display-object/objects/text/text.d.ts +9 -10
  148. package/dist/pixi/display-object/objects/text/text.js +34 -35
  149. package/dist/pixi/game.d.ts +26 -17
  150. package/dist/pixi/game.js +53 -39
  151. package/dist/pixi/helpers/game-assets.d.ts +5 -5
  152. package/dist/pixi/helpers/game-assets.js +14 -11
  153. package/dist/pixi/helpers/position-conversion.helper.d.ts +4 -4
  154. package/dist/pixi/helpers/position-conversion.helper.js +3 -3
  155. package/dist/pixi/index.d.ts +3 -37
  156. package/dist/pixi/index.js +6 -22
  157. package/dist/pixi/modules/CAMERA/camera.d.ts +5 -4
  158. package/dist/pixi/modules/CAMERA/camera.js +9 -9
  159. package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera-view.gateway.d.ts +3 -2
  160. package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/camera-view.gateway.js +1 -1
  161. package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera-view.controller.d.ts +3 -2
  162. package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera-view.controller.js +5 -5
  163. package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.d.ts +3 -3
  164. package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/controllers/camera.controller.js +7 -7
  165. package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/dtos/requests.dto.d.ts +8 -8
  166. package/dist/pixi/modules/CAMERA//342/232/234/357/270/217gateways/dtos/requests.dto.js +8 -8
  167. package/dist/pixi/modules/CAMERA//360/237/223/220services/camera.service.d.ts +2 -2
  168. package/dist/pixi/modules/CAMERA//360/237/223/220services/camera.service.js +12 -12
  169. package/dist/pixi/modules/CAMERA//360/237/247/212entities/camera.entity.js +4 -4
  170. package/dist/pixi/modules/CAMERA//360/237/247/251views/camera.view.d.ts +17 -16
  171. package/dist/pixi/modules/CAMERA//360/237/247/251views/camera.view.js +50 -49
  172. package/dist/pixi/pixi-definitions.d.ts +38 -0
  173. package/dist/pixi/pixi-definitions.js +37 -0
  174. package/dist/pixi/services/keyboard/keyboard.d.ts +6 -4
  175. package/dist/pixi/services/keyboard/keyboard.js +15 -13
  176. package/dist/pixi/services/mouse/mouse-target-focus.service.d.ts +12 -11
  177. package/dist/pixi/services/mouse/mouse-target-focus.service.js +31 -30
  178. package/dist/pixi/services/mouse/mouse.service.d.ts +16 -6
  179. package/dist/pixi/services/mouse/mouse.service.js +42 -22
  180. package/dist/utilities/animator/animating-content/fade-in-content.d.ts +18 -0
  181. package/dist/utilities/animator/animating-content/fade-in-content.js +37 -0
  182. package/dist/utilities/animator/animating-content/fade-in-content.test.d.ts +1 -0
  183. package/dist/utilities/animator/animating-content/fade-in-content.test.js +10 -0
  184. package/dist/utilities/animator/animating-content/slide-in-content.d.ts +37 -0
  185. package/dist/utilities/animator/animating-content/slide-in-content.js +99 -0
  186. package/dist/utilities/animator/animating-content/slide-in-content.test.d.ts +1 -0
  187. package/dist/utilities/animator/animating-content/slide-in-content.test.js +10 -0
  188. package/dist/utilities/animator/animations.d.ts +45 -0
  189. package/dist/utilities/animator/animations.js +92 -0
  190. package/dist/utilities/animator/animator/animator.d.ts +44 -0
  191. package/dist/utilities/animator/animator/animator.js +234 -0
  192. package/dist/utilities/animator/animator/animator.memory-leak.test.d.ts +1 -0
  193. package/dist/utilities/animator/animator/animator.memory-leak.test.js +73 -0
  194. package/dist/utilities/animator/animator/animator.performance.test.d.ts +1 -0
  195. package/dist/utilities/animator/animator/animator.performance.test.js +116 -0
  196. package/dist/utilities/animator/animator/animator.test.d.ts +1 -0
  197. package/dist/utilities/animator/animator/animator.test.js +1046 -0
  198. package/dist/utilities/animator/animator.d.ts +60 -0
  199. package/dist/utilities/animator/animator.js +322 -0
  200. package/dist/utilities/animator/animator.performance.test.d.ts +1 -0
  201. package/dist/utilities/animator/animator.performance.test.js +46 -0
  202. package/dist/utilities/animator/animator.test.d.ts +1 -0
  203. package/dist/utilities/animator/animator.test.js +928 -0
  204. package/dist/utilities/animator/animator2/animator.d.ts +42 -0
  205. package/dist/utilities/animator/animator2/animator.js +222 -0
  206. package/dist/utilities/animator/animator2/animator.memory-leak.test.d.ts +1 -0
  207. package/dist/utilities/animator/animator2/animator.memory-leak.test.js +73 -0
  208. package/dist/utilities/animator/animator2/animator.performance.test.d.ts +1 -0
  209. package/dist/utilities/animator/animator2/animator.performance.test.js +65 -0
  210. package/dist/utilities/animator/animator2/animator.test.d.ts +1 -0
  211. package/dist/utilities/animator/animator2/animator.test.js +1007 -0
  212. package/dist/utilities/animator/animator_old/animator.d.ts +60 -0
  213. package/dist/utilities/animator/animator_old/animator.js +337 -0
  214. package/dist/utilities/animator/animator_old/animator.performance.test.d.ts +1 -0
  215. package/dist/utilities/animator/animator_old/animator.performance.test.js +121 -0
  216. package/dist/utilities/animator/animator_old/animator.test.d.ts +1 -0
  217. package/dist/utilities/animator/animator_old/animator.test.js +996 -0
  218. package/dist/utilities/animator/content-animations/fade-in/fade-in-content.d.ts +18 -0
  219. package/dist/utilities/animator/content-animations/fade-in/fade-in-content.js +37 -0
  220. package/dist/utilities/animator/content-animations/fade-in/fade-in-content.test.d.ts +1 -0
  221. package/dist/utilities/animator/content-animations/fade-in/fade-in-content.test.js +10 -0
  222. package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.d.ts +38 -0
  223. package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.js +208 -0
  224. package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.test.d.ts +1 -0
  225. package/dist/utilities/animator/content-animations/fade-in/fade-in-state-animation.test.js +439 -0
  226. package/dist/utilities/animator/content-animations/slide/slide-in-content.d.ts +41 -0
  227. package/dist/utilities/animator/content-animations/slide/slide-in-content.js +107 -0
  228. package/dist/utilities/animator/content-animations/slide/slide-in-content.test.d.ts +1 -0
  229. package/dist/utilities/animator/content-animations/slide/slide-in-content.test.js +10 -0
  230. package/dist/utilities/animator/content-animations/slide/slide-state-animation.d.ts +24 -0
  231. package/dist/utilities/animator/content-animations/slide/slide-state-animation.js +138 -0
  232. package/dist/utilities/animator/content-animations/slide/slide-state-animation.test.d.ts +1 -0
  233. package/dist/utilities/animator/content-animations/slide/slide-state-animation.test.js +307 -0
  234. package/dist/utilities/animator/content-animations/slide/state-animation.d.ts +37 -0
  235. package/dist/utilities/animator/content-animations/slide/state-animation.js +170 -0
  236. package/dist/utilities/animator/content-animations/slide/state-animation.test.d.ts +1 -0
  237. package/dist/utilities/animator/content-animations/slide/state-animation.test.js +340 -0
  238. package/dist/utilities/animator/index.d.ts +7 -0
  239. package/dist/utilities/animator/index.js +24 -0
  240. package/dist/utilities/animator/state-animation/fade-in/fade-in-content.d.ts +18 -0
  241. package/dist/utilities/animator/state-animation/fade-in/fade-in-content.js +37 -0
  242. package/dist/utilities/animator/state-animation/fade-in/fade-in-content.test.d.ts +1 -0
  243. package/dist/utilities/animator/state-animation/fade-in/fade-in-content.test.js +10 -0
  244. package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.d.ts +32 -0
  245. package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.js +168 -0
  246. package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.test.d.ts +1 -0
  247. package/dist/utilities/animator/state-animation/fade-in/fade-in-state-animation.test.js +431 -0
  248. package/dist/utilities/animator/state-animation/slide/slide-in-content.d.ts +37 -0
  249. package/dist/utilities/animator/state-animation/slide/slide-in-content.js +100 -0
  250. package/dist/utilities/animator/state-animation/slide/slide-in-content.test.d.ts +1 -0
  251. package/dist/utilities/animator/state-animation/slide/slide-in-content.test.js +10 -0
  252. package/dist/utilities/animator/state-animation/slide/slide-state-animation.d.ts +24 -0
  253. package/dist/utilities/animator/state-animation/slide/slide-state-animation.js +130 -0
  254. package/dist/utilities/animator/state-animation/slide/slide-state-animation.test.d.ts +1 -0
  255. package/dist/utilities/animator/state-animation/slide/slide-state-animation.test.js +301 -0
  256. package/dist/utilities/animator/state-animation/slide-state-animation.d.ts +24 -0
  257. package/dist/utilities/animator/state-animation/slide-state-animation.js +130 -0
  258. package/dist/utilities/animator/state-animation/slide-state-animation.test.d.ts +1 -0
  259. package/dist/utilities/animator/state-animation/slide-state-animation.test.js +301 -0
  260. package/dist/utilities/animator/state-animation/state-animation.d.ts +33 -0
  261. package/dist/utilities/animator/state-animation/state-animation.js +146 -0
  262. package/dist/utilities/animator/state-animation/state-animation.test.d.ts +1 -0
  263. package/dist/utilities/animator/state-animation/state-animation.test.js +335 -0
  264. package/dist/utilities/animator/state-animation/visit-disappear-state-animation.d.ts +32 -0
  265. package/dist/utilities/animator/state-animation/visit-disappear-state-animation.js +168 -0
  266. package/dist/utilities/animator/state-animation/visit-disappear-state-animation.test.d.ts +1 -0
  267. package/dist/utilities/animator/state-animation/visit-disappear-state-animation.test.js +431 -0
  268. package/dist/utilities/data-structures/vector-set/vector-set.d.ts +7 -0
  269. package/dist/utilities/data-structures/vector-set/vector-set.js +26 -0
  270. package/dist/utilities/delta-time/delta-time.d.ts +3 -0
  271. package/dist/utilities/delta-time/delta-time.js +10 -0
  272. package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.d.ts +6 -0
  273. package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.js +55 -0
  274. package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.test.d.ts +1 -0
  275. package/dist/utilities/grid-algorithms/closest-available-space/closest-available-space.helper.test.js +100 -0
  276. package/dist/utilities/grid-algorithms/path-finder/path-finder.d.ts +8 -0
  277. package/dist/utilities/grid-algorithms/path-finder/path-finder.js +98 -0
  278. package/dist/utilities/grid-algorithms/path-finder/path-finder.test.d.ts +1 -0
  279. package/dist/utilities/grid-algorithms/path-finder/path-finder.test.js +155 -0
  280. package/dist/utilities/grid-algorithms/position-to-grid-position-converter.d.ts +6 -0
  281. package/dist/utilities/grid-algorithms/position-to-grid-position-converter.js +17 -0
  282. package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.d.ts +18 -0
  283. package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.js +129 -0
  284. package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.test.d.ts +1 -0
  285. package/dist/utilities/grid-algorithms/vector-field-path-finder/vector-field-path-finder.test.js +254 -0
  286. package/dist/utilities/index.d.ts +6 -6
  287. package/dist/utilities/index.js +6 -6
  288. package/package.json +8 -6
@@ -10,100 +10,101 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.CameraView = void 0;
13
+ const actions_lib_1 = require("actions-lib");
13
14
  const helpers_lib_1 = require("helpers-lib");
14
15
  const game_entities_1 = require("../../../../game-entities");
15
16
  const utilities_1 = require("../../../../utilities");
17
+ const animator_1 = require("../../../../utilities/animator/animator/animator");
16
18
  const display_object_1 = require("../../../display-object");
17
19
  const container_1 = require("../../../display-object/container");
18
20
  const game_1 = require("../../../game");
19
21
  const camera_entity_1 = require("../\uD83E\uDDCAentities/camera.entity");
20
22
  let CameraView = class CameraView extends game_entities_1.View {
21
- constructor(entity) {
23
+ constructor(_entity) {
22
24
  super();
23
- this.entity = entity;
24
- this.sceneContainer = new container_1.Container().setAlpha(0).displayParent(game_1.Game.instance.stage).attach(this);
25
- this.blackScreen = display_object_1.Graphics.createRectangle(new helpers_lib_1.Vector(1, 1), helpers_lib_1.ColorHelper.black)
25
+ this._entity = _entity;
26
+ this._sceneContainer = new container_1.Container().setAlpha(0).displayParent(game_1.Game.instance.stage).attach(this);
27
+ this._blackScreen = display_object_1.Graphics.createRectangle(new helpers_lib_1.Vector(1, 1), helpers_lib_1.ColorHelper.black)
26
28
  .toSprite({ cache: true })
27
29
  .setAlpha(0)
28
30
  .displayParent(game_1.Game.instance.stage)
29
31
  .attach(this);
30
- this.backgroundScreen = new container_1.Container().displayParent(this.sceneContainer).attach(this);
31
- this.cameraOffsetLayer = new container_1.Container().displayParent(this.sceneContainer).attach(this);
32
- this.foregroundScreenLayer = new container_1.Container().setSortableChildren(true).displayParent(this.sceneContainer).attach(this);
33
- this.cameraLayer = new container_1.Container().setSortableChildren(true).displayParent(this.cameraOffsetLayer).attach(this);
34
- this.foreground = new container_1.Container().setSortableChildren(true).setZIndex(20).displayParent(this.cameraLayer).attach(this);
35
- this.mainLayer = new container_1.Container().setSortableChildren(true).setZIndex(10).displayParent(this.cameraLayer).attach(this);
36
- this.backgroundLayer = new container_1.Container().setZIndex(0).displayParent(this.cameraLayer).attach(this);
37
- this.alphaAnimator = new utilities_1.Animator(this.sceneContainer, 'alpha', {
32
+ this._backgroundScreen = new container_1.Container().displayParent(this._sceneContainer).attach(this);
33
+ this._cameraOffsetLayer = new container_1.Container().displayParent(this._sceneContainer).attach(this);
34
+ this._foregroundScreenLayer = new container_1.Container().setSortableChildren(true).displayParent(this._sceneContainer).attach(this);
35
+ this._cameraLayer = new container_1.Container().setSortableChildren(true).displayParent(this._cameraOffsetLayer).attach(this);
36
+ this._foreground = new container_1.Container().setSortableChildren(true).setZIndex(20).displayParent(this._cameraLayer).attach(this);
37
+ this._mainLayer = new container_1.Container().setSortableChildren(true).setZIndex(10).displayParent(this._cameraLayer).attach(this);
38
+ this._backgroundLayer = new container_1.Container().setZIndex(0).displayParent(this._cameraLayer).attach(this);
39
+ this._alphaAnimator = new animator_1.Animator(this._sceneContainer, 'alpha', {
38
40
  duration: 500,
39
- animation: new utilities_1.AnimationEaseInOutCubic(),
40
- reAnimateHandling: utilities_1.ReAnimateHandlingType.completePrevious,
41
- completeAnimationsHandling: utilities_1.CompleteAnimationsHandlingType.stayInCurrentState
42
- }).attach(this);
43
- this.blackScreenAnimator = new utilities_1.Animator(this.blackScreen, 'alpha', {
41
+ animation: utilities_1.Animations.easeInOutCubic,
42
+ reAnimateHandling: animator_1.ReAnimateHandlingType.CompletePrevious,
43
+ completionHandling: animator_1.AnimationsCompletionHandlingType.StayInCurrentState
44
+ });
45
+ this._blackScreenAnimator = new animator_1.Animator(this._blackScreen, 'alpha', {
44
46
  duration: 500,
45
- animation: new utilities_1.AnimationEaseInOutCubic(),
46
- reAnimateHandling: utilities_1.ReAnimateHandlingType.completePrevious,
47
- completeAnimationsHandling: utilities_1.CompleteAnimationsHandlingType.stayInCurrentState
48
- }).attach(this);
47
+ animation: utilities_1.Animations.easeInOutCubic,
48
+ reAnimateHandling: animator_1.ReAnimateHandlingType.CompletePrevious,
49
+ completionHandling: animator_1.AnimationsCompletionHandlingType.StayInCurrentState
50
+ });
49
51
  game_1.Game.instance.screenSize
50
52
  .subscribe(value => {
51
- this.blackScreen.aspectRatio = value.x / value.y;
52
- this.blackScreen.scale = Math.max(value.x, value.y);
53
- this.blackScreen.setPosition(helpers_lib_1.Vector.zero, { holdFrom: helpers_lib_1.Vector.zero });
53
+ this._blackScreen.aspectRatio = value.x / value.y;
54
+ this._blackScreen.scale = Math.max(value.x, value.y);
55
+ this._blackScreen.setPosition(helpers_lib_1.Vector.zero, { holdFrom: helpers_lib_1.Vector.zero });
54
56
  })
55
57
  .attach(this);
56
- game_1.Game.instance.setScreenPositionToStagePositionFunction(globalMousePosition => new helpers_lib_1.Vector(globalMousePosition.x - this.cameraLayer.position.x - this.cameraOffsetLayer.position.x, globalMousePosition.y - this.cameraLayer.position.y - this.cameraOffsetLayer.position.y));
57
- this.entity.position
58
+ game_1.Game.instance.setScreenPositionToStagePositionFunction(globalMousePosition => new helpers_lib_1.Vector(globalMousePosition.x - this._cameraLayer.position.x - this._cameraOffsetLayer.position.x, globalMousePosition.y - this._cameraLayer.position.y - this._cameraOffsetLayer.position.y));
59
+ this._entity.position
58
60
  .subscribe(position => {
59
- this.cameraLayer.position = this.convertToCameraPosition(position);
61
+ this._cameraLayer.position = this._convertToCameraPosition(position);
60
62
  })
61
63
  .attach(this);
62
- this.entity.offset
64
+ this._entity.offset
63
65
  .subscribe(offset => {
64
- this.cameraOffsetLayer.position = offset;
66
+ this._cameraOffsetLayer.position = offset;
65
67
  })
66
68
  .attach(this);
67
69
  this.appear(true, 'alpha');
68
70
  }
69
71
  destroy() {
70
72
  if (!this.destroyed) {
71
- game_1.Game.instance.resetScreenPositionToStagePositionFunction();
72
73
  super.destroy();
74
+ game_1.Game.instance.resetScreenPositionToStagePositionFunction();
73
75
  }
74
76
  }
75
77
  getLayers() {
76
78
  return {
77
- backgroundScreen: this.backgroundScreen.id,
78
- background: this.backgroundLayer.id,
79
- main: this.mainLayer.id,
80
- foreground: this.foreground.id,
81
- foregroundScreen: this.foregroundScreenLayer.id
79
+ backgroundScreen: this._backgroundScreen.id,
80
+ background: this._backgroundLayer.id,
81
+ main: this._mainLayer.id,
82
+ foreground: this._foreground.id,
83
+ foregroundScreen: this._foregroundScreenLayer.id
82
84
  };
83
85
  }
84
- async appear(value, type) {
86
+ appear(value, type) {
85
87
  switch (type) {
86
88
  case 'alpha':
87
- this.blackScreenAnimator.set({ alpha: 0 });
88
- this.alphaAnimator.set({ alpha: value ? 0 : 1 });
89
- await this.alphaAnimator.animate({ alpha: value ? 1 : 0 });
90
- break;
89
+ this._blackScreenAnimator.set({ alpha: 0 });
90
+ this._alphaAnimator.set({ alpha: value ? 0 : 1 });
91
+ return this._alphaAnimator.animate({ alpha: value ? 1 : 0 }).chain(this);
91
92
  case 'pureBlack':
92
- this.alphaAnimator.set({ alpha: 1 });
93
- this.blackScreenAnimator.set({ alpha: value ? 1 : 0 });
94
- await this.blackScreenAnimator.animate({ alpha: value ? 0 : 1 });
95
- break;
93
+ this._alphaAnimator.set({ alpha: 1 });
94
+ this._blackScreenAnimator.set({ alpha: value ? 1 : 0 });
95
+ return this._blackScreenAnimator.animate({ alpha: value ? 0 : 1 }).chain(this);
96
96
  case 'instant':
97
- this.alphaAnimator.set({ alpha: value ? 1 : 0 });
98
- this.blackScreenAnimator.set({ alpha: value ? 0 : 1 });
99
- break;
97
+ this._alphaAnimator.set({ alpha: value ? 1 : 0 });
98
+ this._blackScreenAnimator.set({ alpha: value ? 0 : 1 });
99
+ return actions_lib_1.SingleEvent.instant();
100
100
  default: {
101
101
  let _ = type;
102
+ throw new Error('Switch ended with value "never".');
102
103
  }
103
104
  }
104
105
  }
105
- convertToCameraPosition(positionInWorld) {
106
- return helpers_lib_1.Vector.fromTo(positionInWorld, game_1.Game.instance.screenSizeCenter.value);
106
+ _convertToCameraPosition(positionInWorld) {
107
+ return helpers_lib_1.Vector.fromTo(positionInWorld, game_1.Game.instance.getScreenSizeCenter());
107
108
  }
108
109
  };
109
110
  exports.CameraView = CameraView;
@@ -0,0 +1,38 @@
1
+ import { RGBColor, Vec2, Vector } from 'helpers-lib';
2
+ export declare const DEFAULT_RESOLUTION = 2;
3
+ export interface AssetDefinition<T extends string = string> {
4
+ readonly id: string;
5
+ readonly url: T;
6
+ }
7
+ export declare enum BlendMode {
8
+ Normal = 0,
9
+ Add = 1,
10
+ Screen = 3,
11
+ Luminosity = 16,
12
+ ColorDodge = 7
13
+ }
14
+ export interface SpriteDefinition {
15
+ readonly id: string;
16
+ readonly scale: number;
17
+ readonly anchor: Vec2;
18
+ readonly size: Vec2;
19
+ readonly boundingShapes?: PolygonDefinition;
20
+ readonly destroyAssetOnDestroy?: boolean;
21
+ }
22
+ export interface GlowingShapeDefinition {
23
+ readonly color: RGBColor;
24
+ readonly shapeAlpha: number;
25
+ readonly glowAlpha: number;
26
+ readonly glowOptions: GlowOptions;
27
+ readonly shapes: PolygonDefinition;
28
+ }
29
+ export type PolygonDefinition = readonly (readonly Vec2[])[];
30
+ export interface GlowOptions {
31
+ readonly color: RGBColor;
32
+ readonly blurRadius: number | Vector;
33
+ readonly expand: number;
34
+ readonly blendMode: BlendMode;
35
+ }
36
+ export type GlowEffectOptions = Partial<GlowOptions> & {
37
+ glowAlpha?: number;
38
+ };
@@ -0,0 +1,37 @@
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
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ exports.BlendMode = exports.DEFAULT_RESOLUTION = void 0;
27
+ const Pixi = __importStar(require("pixi.js"));
28
+ exports.DEFAULT_RESOLUTION = 2;
29
+ var BlendMode;
30
+ (function (BlendMode) {
31
+ BlendMode[BlendMode["Normal"] = 0] = "Normal";
32
+ BlendMode[BlendMode["Add"] = 1] = "Add";
33
+ BlendMode[BlendMode["Screen"] = 3] = "Screen";
34
+ BlendMode[BlendMode["Luminosity"] = 16] = "Luminosity";
35
+ BlendMode[BlendMode["ColorDodge"] = 7] = "ColorDodge";
36
+ })(BlendMode || (exports.BlendMode = BlendMode = {}));
37
+ //# sourceMappingURL=pixi-definitions.js.map
@@ -1,9 +1,11 @@
1
1
  import { Action } from 'actions-lib';
2
2
  export declare class KeyboardService {
3
- readonly keyPressed: Action<string>;
4
- readonly keyReleased: Action<string>;
5
- private listOfPressedKeys;
6
- private listOfJustPressedKeys;
3
+ readonly _keyPressed: Action<string>;
4
+ readonly keyPressed: import("actions-lib").Notifier<string>;
5
+ readonly _keyReleased: Action<string>;
6
+ readonly keyReleased: import("actions-lib").Notifier<string>;
7
+ private _listOfPressedKeys;
8
+ private _listOfJustPressedKeys;
7
9
  constructor();
8
10
  isKeyDown(key: string): boolean;
9
11
  isKeyJustPressed(key: string): boolean;
@@ -15,33 +15,35 @@ const game_entities_1 = require("../../../game-entities");
15
15
  const service_1 = require("../../../game-entities/service/service");
16
16
  let KeyboardService = class KeyboardService {
17
17
  constructor() {
18
- this.keyPressed = new actions_lib_1.Action();
19
- this.keyReleased = new actions_lib_1.Action();
20
- this.listOfPressedKeys = new Set();
21
- this.listOfJustPressedKeys = new Set();
18
+ this._keyPressed = new actions_lib_1.Action();
19
+ this.keyPressed = this._keyPressed.notifier;
20
+ this._keyReleased = new actions_lib_1.Action();
21
+ this.keyReleased = this._keyReleased.notifier;
22
+ this._listOfPressedKeys = new Set();
23
+ this._listOfJustPressedKeys = new Set();
22
24
  window.addEventListener('keydown', event => {
23
- this.listOfPressedKeys.add(event.key);
24
- this.listOfJustPressedKeys.add(event.key);
25
- !event.repeat && this.keyPressed.trigger(event.key);
25
+ this._listOfPressedKeys.add(event.key);
26
+ this._listOfJustPressedKeys.add(event.key);
27
+ !event.repeat && this._keyPressed.trigger(event.key);
26
28
  });
27
29
  window.addEventListener('keyup', event => {
28
- this.listOfPressedKeys.delete(event.key);
29
- this.keyReleased.trigger(event.key);
30
+ this._listOfPressedKeys.delete(event.key);
31
+ this._keyReleased.trigger(event.key);
30
32
  });
31
33
  window.addEventListener('blur', () => {
32
- this.listOfPressedKeys.clear();
34
+ this._listOfPressedKeys.clear();
33
35
  });
34
36
  game_entities_1.UpdateCycle.afterSceneUpdateAction
35
37
  .subscribe(() => {
36
- this.listOfJustPressedKeys.clear();
38
+ this._listOfJustPressedKeys.clear();
37
39
  })
38
40
  .attachToRoot();
39
41
  }
40
42
  isKeyDown(key) {
41
- return this.listOfPressedKeys.has(key);
43
+ return this._listOfPressedKeys.has(key);
42
44
  }
43
45
  isKeyJustPressed(key) {
44
- return this.listOfJustPressedKeys.has(key);
46
+ return this._listOfJustPressedKeys.has(key);
45
47
  }
46
48
  };
47
49
  exports.KeyboardService = KeyboardService;
@@ -2,19 +2,20 @@ import { Action } from 'actions-lib';
2
2
  import { Vector } from 'helpers-lib';
3
3
  import { MouseService } from './mouse.service';
4
4
  export declare class MouseTargetFocusService {
5
- private mouseService;
6
- onTargetFocus: Action<Vector>;
5
+ private _mouseService;
6
+ readonly _onTargetFocus: Action<Vector>;
7
+ readonly onTargetFocus: import("actions-lib").Notifier<Vector>;
7
8
  get focusedInLastFrame(): boolean;
8
9
  get lastFocusedPosition(): Vector | undefined;
9
- private mouseStagePositionPrevious;
10
- private peakValueChange;
11
- private timePassFromLastTrigger;
12
- private triggerAfterCooldown;
10
+ private _mouseStagePositionPrevious;
11
+ private _peakValueChange;
12
+ private _timePassFromLastTrigger;
13
+ private _triggerAfterCooldown;
13
14
  private _focusedInLastFrame;
14
15
  private _lastFocusedPosition;
15
- constructor(mouseService: MouseService);
16
- private update;
17
- private check;
18
- private iterateValues;
19
- private getPositionChange;
16
+ constructor(_mouseService: MouseService);
17
+ private _update;
18
+ private _check;
19
+ private _iterateValues;
20
+ private _getPositionChange;
20
21
  }
@@ -22,57 +22,58 @@ let MouseTargetFocusService = class MouseTargetFocusService {
22
22
  get lastFocusedPosition() {
23
23
  return this._lastFocusedPosition;
24
24
  }
25
- constructor(mouseService) {
26
- this.mouseService = mouseService;
27
- this.onTargetFocus = new actions_lib_1.Action();
28
- this.timePassFromLastTrigger = 0;
29
- this.triggerAfterCooldown = false;
25
+ constructor(_mouseService) {
26
+ this._mouseService = _mouseService;
27
+ this._onTargetFocus = new actions_lib_1.Action();
28
+ this.onTargetFocus = this._onTargetFocus.notifier;
29
+ this._timePassFromLastTrigger = 0;
30
+ this._triggerAfterCooldown = false;
30
31
  this._focusedInLastFrame = false;
31
32
  this._lastFocusedPosition = undefined;
32
33
  update_cycle_1.UpdateCycle.beforeSceneUpdateAction
33
- .subscribe((event) => this.update(event.delta))
34
+ .subscribe((event) => this._update(event.delta))
34
35
  .attachToRoot();
35
36
  }
36
- update(delta) {
37
- if (this.mouseStagePositionPrevious) {
38
- let mousePositionChange = this.getPositionChange(this.mouseService.stagePosition.value, this.mouseStagePositionPrevious);
39
- if (this.peakValueChange === undefined) {
40
- this.peakValueChange = mousePositionChange;
37
+ _update(delta) {
38
+ if (this._mouseStagePositionPrevious) {
39
+ let mousePositionChange = this._getPositionChange(this._mouseService.getStagePosition(), this._mouseStagePositionPrevious);
40
+ if (this._peakValueChange === undefined) {
41
+ this._peakValueChange = mousePositionChange;
41
42
  }
42
43
  else {
43
- this.check(mousePositionChange, delta);
44
+ this._check(mousePositionChange, delta);
44
45
  }
45
46
  }
46
- this.mouseStagePositionPrevious = this.mouseService.stagePosition.value;
47
+ this._mouseStagePositionPrevious = this._mouseService.getStagePosition();
47
48
  }
48
- check(mousePositionChange, delta) {
49
- if (this.peakValueChange - mousePositionChange > 10) {
50
- this.timePassFromLastTrigger = Math.max(250, this.timePassFromLastTrigger);
51
- this.triggerAfterCooldown = true;
49
+ _check(mousePositionChange, delta) {
50
+ if (this._peakValueChange - mousePositionChange > 10) {
51
+ this._timePassFromLastTrigger = Math.max(250, this._timePassFromLastTrigger);
52
+ this._triggerAfterCooldown = true;
52
53
  }
53
- else if (this.timePassFromLastTrigger > 1000) {
54
- this.triggerAfterCooldown = true;
54
+ else if (this._timePassFromLastTrigger > 1000) {
55
+ this._triggerAfterCooldown = true;
55
56
  }
56
- let focusHappened = this.timePassFromLastTrigger >= 300 && this.triggerAfterCooldown;
57
- this.iterateValues(focusHappened, mousePositionChange, delta);
57
+ let focusHappened = this._timePassFromLastTrigger >= 300 && this._triggerAfterCooldown;
58
+ this._iterateValues(focusHappened, mousePositionChange, delta);
58
59
  }
59
- iterateValues(focusHappened, mousePositionChange, delta) {
60
- if (focusHappened || mousePositionChange > this.peakValueChange) {
61
- this.peakValueChange = mousePositionChange;
60
+ _iterateValues(focusHappened, mousePositionChange, delta) {
61
+ if (focusHappened || mousePositionChange > this._peakValueChange) {
62
+ this._peakValueChange = mousePositionChange;
62
63
  }
63
64
  if (focusHappened) {
64
- this.triggerAfterCooldown = false;
65
- this.timePassFromLastTrigger = 0;
65
+ this._triggerAfterCooldown = false;
66
+ this._timePassFromLastTrigger = 0;
66
67
  this._focusedInLastFrame = true;
67
- this._lastFocusedPosition = this.mouseService.stagePosition.value;
68
- this.onTargetFocus.trigger(this._lastFocusedPosition);
68
+ this._lastFocusedPosition = this._mouseService.getStagePosition();
69
+ this._onTargetFocus.trigger(this._lastFocusedPosition);
69
70
  }
70
71
  else {
71
- this.timePassFromLastTrigger += delta;
72
+ this._timePassFromLastTrigger += delta;
72
73
  this._focusedInLastFrame = false;
73
74
  }
74
75
  }
75
- getPositionChange(positionA, positionB) {
76
+ _getPositionChange(positionA, positionB) {
76
77
  let changeVector = helpers_lib_1.Vector.fromTo(positionA, positionB);
77
78
  return Math.abs(changeVector.x) + Math.abs(changeVector.y);
78
79
  }
@@ -1,11 +1,21 @@
1
1
  import { Variable } from 'actions-lib';
2
2
  import { Vector } from 'helpers-lib';
3
3
  export declare class MouseService {
4
- readonly mouseMoved: Variable<boolean>;
5
- readonly stagePosition: Variable<Vector>;
6
- readonly screenPosition: Variable<Vector>;
7
- readonly mainButtonState: Variable<boolean>;
8
- readonly secondaryButtonState: Variable<boolean>;
4
+ readonly _initialMouseMovementHappened: Variable<boolean>;
5
+ readonly onInitialMouseMove: import("actions-lib").Notifier<boolean>;
6
+ get initialMouseMoveHappened(): boolean;
7
+ readonly _stagePosition: Variable<Vector>;
8
+ readonly stagePosition: import("actions-lib").Notifier<Vector>;
9
+ getStagePosition(): Vector;
10
+ readonly _screenPosition: Variable<Vector>;
11
+ readonly screenPosition: import("actions-lib").Notifier<Vector>;
12
+ getScreenPosition(): Vector;
13
+ readonly _mainButtonState: Variable<boolean>;
14
+ readonly mainButtonState: import("actions-lib").Notifier<boolean>;
15
+ getMainButtonState(): boolean;
16
+ readonly _secondaryButtonState: Variable<boolean>;
17
+ readonly secondaryButtonState: import("actions-lib").Notifier<boolean>;
18
+ getSecondaryButtonState(): boolean;
9
19
  constructor();
10
- private startListeningMouseMove;
20
+ private _startListeningMouseMove;
11
21
  }
@@ -14,60 +14,80 @@ const actions_lib_1 = require("actions-lib");
14
14
  const helpers_lib_1 = require("helpers-lib");
15
15
  const service_1 = require("../../../game-entities/service/service");
16
16
  const update_cycle_1 = require("../../../game-entities/update-cycle");
17
- const __1 = require("../..");
17
+ const game_1 = require("../../game");
18
18
  let MouseService = class MouseService {
19
+ get initialMouseMoveHappened() {
20
+ return this._initialMouseMovementHappened.value;
21
+ }
22
+ getStagePosition() {
23
+ return this._stagePosition.value;
24
+ }
25
+ getScreenPosition() {
26
+ return this._screenPosition.value;
27
+ }
28
+ getMainButtonState() {
29
+ return this._mainButtonState.value;
30
+ }
31
+ getSecondaryButtonState() {
32
+ return this._secondaryButtonState.value;
33
+ }
19
34
  constructor() {
20
- this.mouseMoved = new actions_lib_1.Variable().set(false);
21
- this.stagePosition = new actions_lib_1.Variable({ notifyOnChange: true }).set(helpers_lib_1.Vector.zero);
22
- this.screenPosition = new actions_lib_1.Variable({ notifyOnChange: true }).set(helpers_lib_1.Vector.zero);
23
- this.mainButtonState = new actions_lib_1.Variable().set(false);
24
- this.secondaryButtonState = new actions_lib_1.Variable().set(false);
25
- this.startListeningMouseMove();
35
+ this._initialMouseMovementHappened = new actions_lib_1.Variable(false);
36
+ this.onInitialMouseMove = this._initialMouseMovementHappened.notifier;
37
+ this._stagePosition = new actions_lib_1.Variable(helpers_lib_1.Vector.zero, { notifyOnChange: true });
38
+ this.stagePosition = this._stagePosition.notifier;
39
+ this._screenPosition = new actions_lib_1.Variable(helpers_lib_1.Vector.zero, { notifyOnChange: true });
40
+ this.screenPosition = this._screenPosition.notifier;
41
+ this._mainButtonState = new actions_lib_1.Variable(false);
42
+ this.mainButtonState = this._mainButtonState.notifier;
43
+ this._secondaryButtonState = new actions_lib_1.Variable(false);
44
+ this.secondaryButtonState = this._secondaryButtonState.notifier;
45
+ this._startListeningMouseMove();
26
46
  window.addEventListener('mousedown', event => {
27
47
  if (event.button === 0) {
28
- this.mainButtonState.value = true;
48
+ this._mainButtonState.value = true;
29
49
  }
30
50
  else if (event.button === 2) {
31
- this.secondaryButtonState.value = true;
51
+ this._secondaryButtonState.value = true;
32
52
  }
33
53
  });
34
54
  window.addEventListener('mouseup', event => {
35
55
  if (event.button === 0) {
36
- this.mainButtonState.value = false;
56
+ this._mainButtonState.value = false;
37
57
  }
38
58
  else if (event.button === 2) {
39
- this.secondaryButtonState.value = false;
59
+ this._secondaryButtonState.value = false;
40
60
  }
41
61
  });
42
62
  window.addEventListener('blur', () => {
43
- this.mainButtonState.value = false;
44
- this.secondaryButtonState.value = false;
63
+ this._mainButtonState.value = false;
64
+ this._secondaryButtonState.value = false;
45
65
  });
46
66
  }
47
- startListeningMouseMove() {
67
+ _startListeningMouseMove() {
48
68
  let mouseScreenPosition = helpers_lib_1.Vector.zero;
49
69
  window.addEventListener('mousemove', event => {
50
70
  mouseScreenPosition = new helpers_lib_1.Vector(event.clientX, event.clientY);
51
- this.mouseMoved.value = true;
71
+ this._initialMouseMovementHappened.value = true;
52
72
  });
53
73
  update_cycle_1.UpdateCycle.beforeSceneUpdateAction
54
74
  .subscribe(() => {
55
- this.screenPosition.value = mouseScreenPosition;
75
+ this._screenPosition.value = mouseScreenPosition;
56
76
  })
57
77
  .attachToRoot();
58
78
  update_cycle_1.UpdateCycle.afterSceneUpdateAction
59
79
  .subscribe(() => {
60
- let newStagePosition = __1.Game.instance.screenPositonToStagePosition(this.screenPosition.value);
61
- if (newStagePosition.isEqual(this.stagePosition.value)) {
80
+ let newStagePosition = game_1.Game.instance.screenPositonToStagePosition(this._screenPosition.value);
81
+ if (newStagePosition.isEqual(this._stagePosition.value)) {
62
82
  // Trigger pointer move event, because content might slide under the mouse cursor
63
- __1.Game.instance.renderer.events['onPointerMove'](new PointerEvent('pointermove', {
64
- clientX: this.screenPosition.value.x,
65
- clientY: this.screenPosition.value.y,
83
+ game_1.Game.instance.renderer.events['onPointerMove'](new PointerEvent('pointermove', {
84
+ clientX: this._screenPosition.value.x,
85
+ clientY: this._screenPosition.value.y,
66
86
  pointerType: 'mouse'
67
87
  }));
68
88
  }
69
89
  else {
70
- this.stagePosition.value = newStagePosition;
90
+ this._stagePosition.value = newStagePosition;
71
91
  }
72
92
  })
73
93
  .attachToRoot();
@@ -0,0 +1,18 @@
1
+ import { Container } from '../../../pixi';
2
+ import { AnimatorAnimation } from '../animations';
3
+ export interface FadeInContentOptions {
4
+ duration: number;
5
+ animation: AnimatorAnimation;
6
+ }
7
+ export declare class FadeInContent<T> extends Container {
8
+ private createFunction;
9
+ private stateAnimation;
10
+ private content;
11
+ constructor(createFunction: (value: {
12
+ state: T;
13
+ container: Container;
14
+ }) => void, partialOptions?: Partial<FadeInContentOptions>);
15
+ setState(state: T | undefined, options?: {
16
+ instant?: boolean;
17
+ }): this;
18
+ }
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FadeInContent = void 0;
4
+ const pixi_1 = require("../../../pixi");
5
+ const animations_1 = require("../animations");
6
+ const visit_disappear_state_animation_1 = require("../state-animation/visit-disappear-state-animation");
7
+ class FadeInContent extends pixi_1.Container {
8
+ constructor(createFunction, partialOptions) {
9
+ super();
10
+ this.createFunction = createFunction;
11
+ let options = {
12
+ duration: 200,
13
+ animation: new animations_1.AnimationEaseInOut(),
14
+ ...partialOptions
15
+ };
16
+ this.alpha = 0;
17
+ this.stateAnimation = new visit_disappear_state_animation_1.VisitDisappearStateAnimation(options)
18
+ .onStateChange(state => {
19
+ this.content?.destroy();
20
+ this.content = undefined;
21
+ if (state !== undefined) {
22
+ this.content = new pixi_1.Container().displayParent(this).attach(this);
23
+ this.createFunction({ state, container: this.content });
24
+ }
25
+ })
26
+ .onValueChange(value => {
27
+ this.alpha = value;
28
+ })
29
+ .attach(this);
30
+ }
31
+ setState(state, options) {
32
+ this.stateAnimation.setState(state, options);
33
+ return this;
34
+ }
35
+ }
36
+ exports.FadeInContent = FadeInContent;
37
+ //# sourceMappingURL=fade-in-content.js.map
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const vitest_1 = require("vitest");
4
+ const fade_in_content_1 = require("./fade-in-content");
5
+ (0, vitest_1.describe)('Fade In Content', () => {
6
+ (0, vitest_1.test)('should exist', () => {
7
+ (0, vitest_1.expect)(fade_in_content_1.FadeInContent).toBeDefined();
8
+ });
9
+ });
10
+ //# sourceMappingURL=fade-in-content.test.js.map