@esengine/ecs-framework 2.2.21 → 2.3.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 (490) hide show
  1. package/bin/Core/DI/Decorators.d.ts +206 -0
  2. package/bin/Core/DI/Decorators.d.ts.map +1 -0
  3. package/bin/Core/DI/Decorators.js +253 -0
  4. package/bin/Core/DI/Decorators.js.map +1 -0
  5. package/bin/Core/DI/index.d.ts +8 -0
  6. package/bin/Core/DI/index.d.ts.map +1 -0
  7. package/bin/Core/DI/index.js +7 -0
  8. package/bin/Core/DI/index.js.map +1 -0
  9. package/bin/Core/Plugin.d.ts +112 -0
  10. package/bin/Core/Plugin.d.ts.map +1 -0
  11. package/bin/Core/Plugin.js +19 -0
  12. package/bin/Core/Plugin.js.map +1 -0
  13. package/bin/Core/PluginManager.d.ts +118 -0
  14. package/bin/Core/PluginManager.d.ts.map +1 -0
  15. package/bin/Core/PluginManager.js +229 -0
  16. package/bin/Core/PluginManager.js.map +1 -0
  17. package/bin/Core/ServiceContainer.d.ts +221 -0
  18. package/bin/Core/ServiceContainer.d.ts.map +1 -0
  19. package/bin/Core/ServiceContainer.js +352 -0
  20. package/bin/Core/ServiceContainer.js.map +1 -0
  21. package/bin/Core.d.ts +379 -0
  22. package/bin/Core.d.ts.map +1 -0
  23. package/bin/Core.js +553 -0
  24. package/bin/Core.js.map +1 -0
  25. package/bin/ECS/Component.d.ts +104 -0
  26. package/bin/ECS/Component.d.ts.map +1 -0
  27. package/bin/ECS/Component.js +105 -0
  28. package/bin/ECS/Component.js.map +1 -0
  29. package/bin/ECS/Components/HierarchyComponent.d.ts +46 -0
  30. package/bin/ECS/Components/HierarchyComponent.d.ts.map +1 -0
  31. package/bin/ECS/Components/HierarchyComponent.js +65 -0
  32. package/bin/ECS/Components/HierarchyComponent.js.map +1 -0
  33. package/bin/ECS/Components/index.d.ts +2 -0
  34. package/bin/ECS/Components/index.d.ts.map +1 -0
  35. package/bin/ECS/Components/index.js +2 -0
  36. package/bin/ECS/Components/index.js.map +1 -0
  37. package/bin/ECS/Core/ArchetypeSystem.d.ts +103 -0
  38. package/bin/ECS/Core/ArchetypeSystem.d.ts.map +1 -0
  39. package/bin/ECS/Core/ArchetypeSystem.js +244 -0
  40. package/bin/ECS/Core/ArchetypeSystem.js.map +1 -0
  41. package/bin/ECS/Core/CommandBuffer.d.ts +154 -0
  42. package/bin/ECS/Core/CommandBuffer.d.ts.map +1 -0
  43. package/bin/ECS/Core/CommandBuffer.js +244 -0
  44. package/bin/ECS/Core/CommandBuffer.js.map +1 -0
  45. package/bin/ECS/Core/ComponentPool.d.ts +139 -0
  46. package/bin/ECS/Core/ComponentPool.d.ts.map +1 -0
  47. package/bin/ECS/Core/ComponentPool.js +276 -0
  48. package/bin/ECS/Core/ComponentPool.js.map +1 -0
  49. package/bin/ECS/Core/ComponentStorage/ComponentRegistry.d.ts +127 -0
  50. package/bin/ECS/Core/ComponentStorage/ComponentRegistry.d.ts.map +1 -0
  51. package/bin/ECS/Core/ComponentStorage/ComponentRegistry.js +235 -0
  52. package/bin/ECS/Core/ComponentStorage/ComponentRegistry.js.map +1 -0
  53. package/bin/ECS/Core/ComponentStorage.d.ts +185 -0
  54. package/bin/ECS/Core/ComponentStorage.d.ts.map +1 -0
  55. package/bin/ECS/Core/ComponentStorage.js +321 -0
  56. package/bin/ECS/Core/ComponentStorage.js.map +1 -0
  57. package/bin/ECS/Core/EntityLifecyclePolicy.d.ts +26 -0
  58. package/bin/ECS/Core/EntityLifecyclePolicy.d.ts.map +1 -0
  59. package/bin/ECS/Core/EntityLifecyclePolicy.js +2 -0
  60. package/bin/ECS/Core/EntityLifecyclePolicy.js.map +1 -0
  61. package/bin/ECS/Core/EventBus.d.ts +210 -0
  62. package/bin/ECS/Core/EventBus.d.ts.map +1 -0
  63. package/bin/ECS/Core/EventBus.js +370 -0
  64. package/bin/ECS/Core/EventBus.js.map +1 -0
  65. package/bin/ECS/Core/EventSystem.d.ts +225 -0
  66. package/bin/ECS/Core/EventSystem.d.ts.map +1 -0
  67. package/bin/ECS/Core/EventSystem.js +448 -0
  68. package/bin/ECS/Core/EventSystem.js.map +1 -0
  69. package/bin/ECS/Core/Events/index.d.ts +3 -0
  70. package/bin/ECS/Core/Events/index.d.ts.map +1 -0
  71. package/bin/ECS/Core/Events/index.js +3 -0
  72. package/bin/ECS/Core/Events/index.js.map +1 -0
  73. package/bin/ECS/Core/FluentAPI/ComponentBuilder.d.ts +35 -0
  74. package/bin/ECS/Core/FluentAPI/ComponentBuilder.d.ts.map +1 -0
  75. package/bin/ECS/Core/FluentAPI/ComponentBuilder.js +48 -0
  76. package/bin/ECS/Core/FluentAPI/ComponentBuilder.js.map +1 -0
  77. package/bin/ECS/Core/FluentAPI/ECSFluentAPI.d.ts +135 -0
  78. package/bin/ECS/Core/FluentAPI/ECSFluentAPI.d.ts.map +1 -0
  79. package/bin/ECS/Core/FluentAPI/ECSFluentAPI.js +166 -0
  80. package/bin/ECS/Core/FluentAPI/ECSFluentAPI.js.map +1 -0
  81. package/bin/ECS/Core/FluentAPI/EntityBatchOperator.d.ts +58 -0
  82. package/bin/ECS/Core/FluentAPI/EntityBatchOperator.d.ts.map +1 -0
  83. package/bin/ECS/Core/FluentAPI/EntityBatchOperator.js +85 -0
  84. package/bin/ECS/Core/FluentAPI/EntityBatchOperator.js.map +1 -0
  85. package/bin/ECS/Core/FluentAPI/EntityBuilder.d.ts +110 -0
  86. package/bin/ECS/Core/FluentAPI/EntityBuilder.d.ts.map +1 -0
  87. package/bin/ECS/Core/FluentAPI/EntityBuilder.js +181 -0
  88. package/bin/ECS/Core/FluentAPI/EntityBuilder.js.map +1 -0
  89. package/bin/ECS/Core/FluentAPI/SceneBuilder.d.ts +53 -0
  90. package/bin/ECS/Core/FluentAPI/SceneBuilder.d.ts.map +1 -0
  91. package/bin/ECS/Core/FluentAPI/SceneBuilder.js +79 -0
  92. package/bin/ECS/Core/FluentAPI/SceneBuilder.js.map +1 -0
  93. package/bin/ECS/Core/FluentAPI/index.d.ts +6 -0
  94. package/bin/ECS/Core/FluentAPI/index.d.ts.map +1 -0
  95. package/bin/ECS/Core/FluentAPI/index.js +6 -0
  96. package/bin/ECS/Core/FluentAPI/index.js.map +1 -0
  97. package/bin/ECS/Core/FluentAPI.d.ts +2 -0
  98. package/bin/ECS/Core/FluentAPI.d.ts.map +1 -0
  99. package/bin/ECS/Core/FluentAPI.js +3 -0
  100. package/bin/ECS/Core/FluentAPI.js.map +1 -0
  101. package/bin/ECS/Core/Query/TypedQuery.d.ts +214 -0
  102. package/bin/ECS/Core/Query/TypedQuery.d.ts.map +1 -0
  103. package/bin/ECS/Core/Query/TypedQuery.js +294 -0
  104. package/bin/ECS/Core/Query/TypedQuery.js.map +1 -0
  105. package/bin/ECS/Core/Query/index.d.ts +3 -0
  106. package/bin/ECS/Core/Query/index.d.ts.map +1 -0
  107. package/bin/ECS/Core/Query/index.js +3 -0
  108. package/bin/ECS/Core/Query/index.js.map +1 -0
  109. package/bin/ECS/Core/QuerySystem.d.ts +458 -0
  110. package/bin/ECS/Core/QuerySystem.d.ts.map +1 -0
  111. package/bin/ECS/Core/QuerySystem.js +1069 -0
  112. package/bin/ECS/Core/QuerySystem.js.map +1 -0
  113. package/bin/ECS/Core/QueryTypes.d.ts +34 -0
  114. package/bin/ECS/Core/QueryTypes.d.ts.map +1 -0
  115. package/bin/ECS/Core/QueryTypes.js +13 -0
  116. package/bin/ECS/Core/QueryTypes.js.map +1 -0
  117. package/bin/ECS/Core/ReactiveQuery.d.ts +211 -0
  118. package/bin/ECS/Core/ReactiveQuery.d.ts.map +1 -0
  119. package/bin/ECS/Core/ReactiveQuery.js +401 -0
  120. package/bin/ECS/Core/ReactiveQuery.js.map +1 -0
  121. package/bin/ECS/Core/ReferenceTracker.d.ts +111 -0
  122. package/bin/ECS/Core/ReferenceTracker.d.ts.map +1 -0
  123. package/bin/ECS/Core/ReferenceTracker.js +254 -0
  124. package/bin/ECS/Core/ReferenceTracker.js.map +1 -0
  125. package/bin/ECS/Core/SoASerializer.d.ts +28 -0
  126. package/bin/ECS/Core/SoASerializer.d.ts.map +1 -0
  127. package/bin/ECS/Core/SoASerializer.js +85 -0
  128. package/bin/ECS/Core/SoASerializer.js.map +1 -0
  129. package/bin/ECS/Core/SoAStorage.d.ts +129 -0
  130. package/bin/ECS/Core/SoAStorage.d.ts.map +1 -0
  131. package/bin/ECS/Core/SoAStorage.js +685 -0
  132. package/bin/ECS/Core/SoAStorage.js.map +1 -0
  133. package/bin/ECS/Core/SoATypeRegistry.d.ts +50 -0
  134. package/bin/ECS/Core/SoATypeRegistry.d.ts.map +1 -0
  135. package/bin/ECS/Core/SoATypeRegistry.js +135 -0
  136. package/bin/ECS/Core/SoATypeRegistry.js.map +1 -0
  137. package/bin/ECS/Core/Storage/index.d.ts +4 -0
  138. package/bin/ECS/Core/Storage/index.d.ts.map +1 -0
  139. package/bin/ECS/Core/Storage/index.js +4 -0
  140. package/bin/ECS/Core/Storage/index.js.map +1 -0
  141. package/bin/ECS/Core/StorageDecorators.d.ts +20 -0
  142. package/bin/ECS/Core/StorageDecorators.d.ts.map +1 -0
  143. package/bin/ECS/Core/StorageDecorators.js +27 -0
  144. package/bin/ECS/Core/StorageDecorators.js.map +1 -0
  145. package/bin/ECS/CoreEvents.d.ts +131 -0
  146. package/bin/ECS/CoreEvents.d.ts.map +1 -0
  147. package/bin/ECS/CoreEvents.js +163 -0
  148. package/bin/ECS/CoreEvents.js.map +1 -0
  149. package/bin/ECS/Decorators/EntityRefDecorator.d.ts +46 -0
  150. package/bin/ECS/Decorators/EntityRefDecorator.d.ts.map +1 -0
  151. package/bin/ECS/Decorators/EntityRefDecorator.js +118 -0
  152. package/bin/ECS/Decorators/EntityRefDecorator.js.map +1 -0
  153. package/bin/ECS/Decorators/PropertyDecorator.d.ts +168 -0
  154. package/bin/ECS/Decorators/PropertyDecorator.d.ts.map +1 -0
  155. package/bin/ECS/Decorators/PropertyDecorator.js +40 -0
  156. package/bin/ECS/Decorators/PropertyDecorator.js.map +1 -0
  157. package/bin/ECS/Decorators/TypeDecorators.d.ts +124 -0
  158. package/bin/ECS/Decorators/TypeDecorators.d.ts.map +1 -0
  159. package/bin/ECS/Decorators/TypeDecorators.js +151 -0
  160. package/bin/ECS/Decorators/TypeDecorators.js.map +1 -0
  161. package/bin/ECS/Decorators/index.d.ts +7 -0
  162. package/bin/ECS/Decorators/index.d.ts.map +1 -0
  163. package/bin/ECS/Decorators/index.js +4 -0
  164. package/bin/ECS/Decorators/index.js.map +1 -0
  165. package/bin/ECS/Entity.d.ts +415 -0
  166. package/bin/ECS/Entity.d.ts.map +1 -0
  167. package/bin/ECS/Entity.js +683 -0
  168. package/bin/ECS/Entity.js.map +1 -0
  169. package/bin/ECS/EntityTags.d.ts +71 -0
  170. package/bin/ECS/EntityTags.d.ts.map +1 -0
  171. package/bin/ECS/EntityTags.js +82 -0
  172. package/bin/ECS/EntityTags.js.map +1 -0
  173. package/bin/ECS/IScene.d.ts +308 -0
  174. package/bin/ECS/IScene.d.ts.map +1 -0
  175. package/bin/ECS/IScene.js +2 -0
  176. package/bin/ECS/IScene.js.map +1 -0
  177. package/bin/ECS/Scene.d.ts +799 -0
  178. package/bin/ECS/Scene.d.ts.map +1 -0
  179. package/bin/ECS/Scene.js +1203 -0
  180. package/bin/ECS/Scene.js.map +1 -0
  181. package/bin/ECS/SceneManager.d.ts +197 -0
  182. package/bin/ECS/SceneManager.d.ts.map +1 -0
  183. package/bin/ECS/SceneManager.js +264 -0
  184. package/bin/ECS/SceneManager.js.map +1 -0
  185. package/bin/ECS/Serialization/ComponentSerializer.d.ts +106 -0
  186. package/bin/ECS/Serialization/ComponentSerializer.d.ts.map +1 -0
  187. package/bin/ECS/Serialization/ComponentSerializer.js +251 -0
  188. package/bin/ECS/Serialization/ComponentSerializer.js.map +1 -0
  189. package/bin/ECS/Serialization/EntitySerializer.d.ts +111 -0
  190. package/bin/ECS/Serialization/EntitySerializer.d.ts.map +1 -0
  191. package/bin/ECS/Serialization/EntitySerializer.js +155 -0
  192. package/bin/ECS/Serialization/EntitySerializer.js.map +1 -0
  193. package/bin/ECS/Serialization/IncrementalSerializer.d.ts +259 -0
  194. package/bin/ECS/Serialization/IncrementalSerializer.d.ts.map +1 -0
  195. package/bin/ECS/Serialization/IncrementalSerializer.js +500 -0
  196. package/bin/ECS/Serialization/IncrementalSerializer.js.map +1 -0
  197. package/bin/ECS/Serialization/SceneSerializer.d.ts +213 -0
  198. package/bin/ECS/Serialization/SceneSerializer.d.ts.map +1 -0
  199. package/bin/ECS/Serialization/SceneSerializer.js +387 -0
  200. package/bin/ECS/Serialization/SceneSerializer.js.map +1 -0
  201. package/bin/ECS/Serialization/SerializationDecorators.d.ts +136 -0
  202. package/bin/ECS/Serialization/SerializationDecorators.d.ts.map +1 -0
  203. package/bin/ECS/Serialization/SerializationDecorators.js +216 -0
  204. package/bin/ECS/Serialization/SerializationDecorators.js.map +1 -0
  205. package/bin/ECS/Serialization/VersionMigration.d.ts +156 -0
  206. package/bin/ECS/Serialization/VersionMigration.d.ts.map +1 -0
  207. package/bin/ECS/Serialization/VersionMigration.js +279 -0
  208. package/bin/ECS/Serialization/VersionMigration.js.map +1 -0
  209. package/bin/ECS/Serialization/index.d.ts +18 -0
  210. package/bin/ECS/Serialization/index.d.ts.map +1 -0
  211. package/bin/ECS/Serialization/index.js +18 -0
  212. package/bin/ECS/Serialization/index.js.map +1 -0
  213. package/bin/ECS/Systems/EntityCache.d.ts +114 -0
  214. package/bin/ECS/Systems/EntityCache.d.ts.map +1 -0
  215. package/bin/ECS/Systems/EntityCache.js +145 -0
  216. package/bin/ECS/Systems/EntityCache.js.map +1 -0
  217. package/bin/ECS/Systems/EntitySystem.d.ts +591 -0
  218. package/bin/ECS/Systems/EntitySystem.d.ts.map +1 -0
  219. package/bin/ECS/Systems/EntitySystem.js +1102 -0
  220. package/bin/ECS/Systems/EntitySystem.js.map +1 -0
  221. package/bin/ECS/Systems/HierarchySystem.d.ts +155 -0
  222. package/bin/ECS/Systems/HierarchySystem.d.ts.map +1 -0
  223. package/bin/ECS/Systems/HierarchySystem.js +498 -0
  224. package/bin/ECS/Systems/HierarchySystem.js.map +1 -0
  225. package/bin/ECS/Systems/IntervalSystem.d.ts +33 -0
  226. package/bin/ECS/Systems/IntervalSystem.d.ts.map +1 -0
  227. package/bin/ECS/Systems/IntervalSystem.js +50 -0
  228. package/bin/ECS/Systems/IntervalSystem.js.map +1 -0
  229. package/bin/ECS/Systems/PassiveSystem.d.ts +17 -0
  230. package/bin/ECS/Systems/PassiveSystem.d.ts.map +1 -0
  231. package/bin/ECS/Systems/PassiveSystem.js +19 -0
  232. package/bin/ECS/Systems/PassiveSystem.js.map +1 -0
  233. package/bin/ECS/Systems/ProcessingSystem.d.ts +21 -0
  234. package/bin/ECS/Systems/ProcessingSystem.d.ts.map +1 -0
  235. package/bin/ECS/Systems/ProcessingSystem.js +20 -0
  236. package/bin/ECS/Systems/ProcessingSystem.js.map +1 -0
  237. package/bin/ECS/Systems/WorkerEntitySystem.d.ts +313 -0
  238. package/bin/ECS/Systems/WorkerEntitySystem.d.ts.map +1 -0
  239. package/bin/ECS/Systems/WorkerEntitySystem.js +792 -0
  240. package/bin/ECS/Systems/WorkerEntitySystem.js.map +1 -0
  241. package/bin/ECS/Systems/index.d.ts +8 -0
  242. package/bin/ECS/Systems/index.d.ts.map +1 -0
  243. package/bin/ECS/Systems/index.js +8 -0
  244. package/bin/ECS/Systems/index.js.map +1 -0
  245. package/bin/ECS/TypedEntity.d.ts +192 -0
  246. package/bin/ECS/TypedEntity.d.ts.map +1 -0
  247. package/bin/ECS/TypedEntity.js +254 -0
  248. package/bin/ECS/TypedEntity.js.map +1 -0
  249. package/bin/ECS/Utils/BigIntCompatibility.d.ts +151 -0
  250. package/bin/ECS/Utils/BigIntCompatibility.d.ts.map +1 -0
  251. package/bin/ECS/Utils/BigIntCompatibility.js +476 -0
  252. package/bin/ECS/Utils/BigIntCompatibility.js.map +1 -0
  253. package/bin/ECS/Utils/BitMaskHashMap.d.ts +28 -0
  254. package/bin/ECS/Utils/BitMaskHashMap.d.ts.map +1 -0
  255. package/bin/ECS/Utils/BitMaskHashMap.js +127 -0
  256. package/bin/ECS/Utils/BitMaskHashMap.js.map +1 -0
  257. package/bin/ECS/Utils/Bits.d.ts +154 -0
  258. package/bin/ECS/Utils/Bits.d.ts.map +1 -0
  259. package/bin/ECS/Utils/Bits.js +331 -0
  260. package/bin/ECS/Utils/Bits.js.map +1 -0
  261. package/bin/ECS/Utils/ComponentSparseSet.d.ts +143 -0
  262. package/bin/ECS/Utils/ComponentSparseSet.d.ts.map +1 -0
  263. package/bin/ECS/Utils/ComponentSparseSet.js +347 -0
  264. package/bin/ECS/Utils/ComponentSparseSet.js.map +1 -0
  265. package/bin/ECS/Utils/EntityList.d.ts +115 -0
  266. package/bin/ECS/Utils/EntityList.d.ts.map +1 -0
  267. package/bin/ECS/Utils/EntityList.js +258 -0
  268. package/bin/ECS/Utils/EntityList.js.map +1 -0
  269. package/bin/ECS/Utils/EntityProcessorList.d.ts +56 -0
  270. package/bin/ECS/Utils/EntityProcessorList.d.ts.map +1 -0
  271. package/bin/ECS/Utils/EntityProcessorList.js +113 -0
  272. package/bin/ECS/Utils/EntityProcessorList.js.map +1 -0
  273. package/bin/ECS/Utils/IdentifierPool.d.ts +203 -0
  274. package/bin/ECS/Utils/IdentifierPool.d.ts.map +1 -0
  275. package/bin/ECS/Utils/IdentifierPool.js +325 -0
  276. package/bin/ECS/Utils/IdentifierPool.js.map +1 -0
  277. package/bin/ECS/Utils/Matcher.d.ts +171 -0
  278. package/bin/ECS/Utils/Matcher.d.ts.map +1 -0
  279. package/bin/ECS/Utils/Matcher.js +293 -0
  280. package/bin/ECS/Utils/Matcher.js.map +1 -0
  281. package/bin/ECS/Utils/SparseSet.d.ts +170 -0
  282. package/bin/ECS/Utils/SparseSet.d.ts.map +1 -0
  283. package/bin/ECS/Utils/SparseSet.js +280 -0
  284. package/bin/ECS/Utils/SparseSet.js.map +1 -0
  285. package/bin/ECS/Utils/index.d.ts +9 -0
  286. package/bin/ECS/Utils/index.d.ts.map +1 -0
  287. package/bin/ECS/Utils/index.js +10 -0
  288. package/bin/ECS/Utils/index.js.map +1 -0
  289. package/bin/ECS/World.d.ts +238 -0
  290. package/bin/ECS/World.d.ts.map +1 -0
  291. package/bin/ECS/World.js +416 -0
  292. package/bin/ECS/World.js.map +1 -0
  293. package/bin/ECS/WorldManager.d.ts +224 -0
  294. package/bin/ECS/WorldManager.d.ts.map +1 -0
  295. package/bin/ECS/WorldManager.js +365 -0
  296. package/bin/ECS/WorldManager.js.map +1 -0
  297. package/bin/ECS/index.d.ts +26 -0
  298. package/bin/ECS/index.d.ts.map +1 -0
  299. package/bin/ECS/index.js +21 -0
  300. package/bin/ECS/index.js.map +1 -0
  301. package/bin/Platform/IPlatformAdapter.d.ts +169 -0
  302. package/bin/Platform/IPlatformAdapter.d.ts.map +1 -0
  303. package/bin/Platform/IPlatformAdapter.js +2 -0
  304. package/bin/Platform/IPlatformAdapter.js.map +1 -0
  305. package/bin/Platform/PlatformDetector.d.ts +56 -0
  306. package/bin/Platform/PlatformDetector.d.ts.map +1 -0
  307. package/bin/Platform/PlatformDetector.js +247 -0
  308. package/bin/Platform/PlatformDetector.js.map +1 -0
  309. package/bin/Platform/PlatformManager.d.ts +50 -0
  310. package/bin/Platform/PlatformManager.d.ts.map +1 -0
  311. package/bin/Platform/PlatformManager.js +114 -0
  312. package/bin/Platform/PlatformManager.js.map +1 -0
  313. package/bin/Platform/index.d.ts +19 -0
  314. package/bin/Platform/index.d.ts.map +1 -0
  315. package/bin/Platform/index.js +29 -0
  316. package/bin/Platform/index.js.map +1 -0
  317. package/bin/Plugins/DebugPlugin.d.ts +156 -0
  318. package/bin/Plugins/DebugPlugin.d.ts.map +1 -0
  319. package/bin/Plugins/DebugPlugin.js +248 -0
  320. package/bin/Plugins/DebugPlugin.js.map +1 -0
  321. package/bin/Plugins/index.d.ts +2 -0
  322. package/bin/Plugins/index.d.ts.map +1 -0
  323. package/bin/Plugins/index.js +2 -0
  324. package/bin/Plugins/index.js.map +1 -0
  325. package/bin/Types/IUpdatable.d.ts +18 -0
  326. package/bin/Types/IUpdatable.d.ts.map +1 -0
  327. package/bin/Types/IUpdatable.js +7 -0
  328. package/bin/Types/IUpdatable.js.map +1 -0
  329. package/bin/Types/TypeHelpers.d.ts +238 -0
  330. package/bin/Types/TypeHelpers.d.ts.map +1 -0
  331. package/bin/Types/TypeHelpers.js +19 -0
  332. package/bin/Types/TypeHelpers.js.map +1 -0
  333. package/bin/Types/index.d.ts +466 -0
  334. package/bin/Types/index.d.ts.map +1 -0
  335. package/bin/Types/index.js +7 -0
  336. package/bin/Types/index.js.map +1 -0
  337. package/bin/Utils/BinarySerializer.d.ts +23 -0
  338. package/bin/Utils/BinarySerializer.d.ts.map +1 -0
  339. package/bin/Utils/BinarySerializer.js +100 -0
  340. package/bin/Utils/BinarySerializer.js.map +1 -0
  341. package/bin/Utils/Debug/AdvancedProfilerCollector.d.ts +153 -0
  342. package/bin/Utils/Debug/AdvancedProfilerCollector.d.ts.map +1 -0
  343. package/bin/Utils/Debug/AdvancedProfilerCollector.js +406 -0
  344. package/bin/Utils/Debug/AdvancedProfilerCollector.js.map +1 -0
  345. package/bin/Utils/Debug/ComponentDataCollector.d.ts +32 -0
  346. package/bin/Utils/Debug/ComponentDataCollector.d.ts.map +1 -0
  347. package/bin/Utils/Debug/ComponentDataCollector.js +250 -0
  348. package/bin/Utils/Debug/ComponentDataCollector.js.map +1 -0
  349. package/bin/Utils/Debug/DebugConfigService.d.ts +16 -0
  350. package/bin/Utils/Debug/DebugConfigService.d.ts.map +1 -0
  351. package/bin/Utils/Debug/DebugConfigService.js +42 -0
  352. package/bin/Utils/Debug/DebugConfigService.js.map +1 -0
  353. package/bin/Utils/Debug/DebugManager.d.ts +131 -0
  354. package/bin/Utils/Debug/DebugManager.d.ts.map +1 -0
  355. package/bin/Utils/Debug/DebugManager.js +848 -0
  356. package/bin/Utils/Debug/DebugManager.js.map +1 -0
  357. package/bin/Utils/Debug/EntityDataCollector.d.ts +115 -0
  358. package/bin/Utils/Debug/EntityDataCollector.d.ts.map +1 -0
  359. package/bin/Utils/Debug/EntityDataCollector.js +870 -0
  360. package/bin/Utils/Debug/EntityDataCollector.js.map +1 -0
  361. package/bin/Utils/Debug/PerformanceDataCollector.d.ts +31 -0
  362. package/bin/Utils/Debug/PerformanceDataCollector.d.ts.map +1 -0
  363. package/bin/Utils/Debug/PerformanceDataCollector.js +203 -0
  364. package/bin/Utils/Debug/PerformanceDataCollector.js.map +1 -0
  365. package/bin/Utils/Debug/SceneDataCollector.d.ts +18 -0
  366. package/bin/Utils/Debug/SceneDataCollector.d.ts.map +1 -0
  367. package/bin/Utils/Debug/SceneDataCollector.js +43 -0
  368. package/bin/Utils/Debug/SceneDataCollector.js.map +1 -0
  369. package/bin/Utils/Debug/SystemDataCollector.d.ts +14 -0
  370. package/bin/Utils/Debug/SystemDataCollector.d.ts.map +1 -0
  371. package/bin/Utils/Debug/SystemDataCollector.js +60 -0
  372. package/bin/Utils/Debug/SystemDataCollector.js.map +1 -0
  373. package/bin/Utils/Debug/WebSocketManager.d.ts +54 -0
  374. package/bin/Utils/Debug/WebSocketManager.d.ts.map +1 -0
  375. package/bin/Utils/Debug/WebSocketManager.js +141 -0
  376. package/bin/Utils/Debug/WebSocketManager.js.map +1 -0
  377. package/bin/Utils/Debug/index.d.ts +11 -0
  378. package/bin/Utils/Debug/index.d.ts.map +1 -0
  379. package/bin/Utils/Debug/index.js +10 -0
  380. package/bin/Utils/Debug/index.js.map +1 -0
  381. package/bin/Utils/Emitter.d.ts +61 -0
  382. package/bin/Utils/Emitter.d.ts.map +1 -0
  383. package/bin/Utils/Emitter.js +101 -0
  384. package/bin/Utils/Emitter.js.map +1 -0
  385. package/bin/Utils/Extensions/NumberExtension.d.ts +13 -0
  386. package/bin/Utils/Extensions/NumberExtension.d.ts.map +1 -0
  387. package/bin/Utils/Extensions/NumberExtension.js +17 -0
  388. package/bin/Utils/Extensions/NumberExtension.js.map +1 -0
  389. package/bin/Utils/Extensions/TypeUtils.d.ts +13 -0
  390. package/bin/Utils/Extensions/TypeUtils.d.ts.map +1 -0
  391. package/bin/Utils/Extensions/TypeUtils.js +15 -0
  392. package/bin/Utils/Extensions/TypeUtils.js.map +1 -0
  393. package/bin/Utils/Extensions/index.d.ts +3 -0
  394. package/bin/Utils/Extensions/index.d.ts.map +1 -0
  395. package/bin/Utils/Extensions/index.js +4 -0
  396. package/bin/Utils/Extensions/index.js.map +1 -0
  397. package/bin/Utils/GlobalManager.d.ts +29 -0
  398. package/bin/Utils/GlobalManager.d.ts.map +1 -0
  399. package/bin/Utils/GlobalManager.js +50 -0
  400. package/bin/Utils/GlobalManager.js.map +1 -0
  401. package/bin/Utils/Logger/ConsoleLogger.d.ts +74 -0
  402. package/bin/Utils/Logger/ConsoleLogger.d.ts.map +1 -0
  403. package/bin/Utils/Logger/ConsoleLogger.js +187 -0
  404. package/bin/Utils/Logger/ConsoleLogger.js.map +1 -0
  405. package/bin/Utils/Logger/Constants.d.ts +36 -0
  406. package/bin/Utils/Logger/Constants.d.ts.map +1 -0
  407. package/bin/Utils/Logger/Constants.js +40 -0
  408. package/bin/Utils/Logger/Constants.js.map +1 -0
  409. package/bin/Utils/Logger/LoggerManager.d.ts +91 -0
  410. package/bin/Utils/Logger/LoggerManager.d.ts.map +1 -0
  411. package/bin/Utils/Logger/LoggerManager.js +167 -0
  412. package/bin/Utils/Logger/LoggerManager.js.map +1 -0
  413. package/bin/Utils/Logger/Types.d.ts +40 -0
  414. package/bin/Utils/Logger/Types.d.ts.map +1 -0
  415. package/bin/Utils/Logger/Types.js +2 -0
  416. package/bin/Utils/Logger/Types.js.map +1 -0
  417. package/bin/Utils/Logger/index.d.ts +5 -0
  418. package/bin/Utils/Logger/index.d.ts.map +1 -0
  419. package/bin/Utils/Logger/index.js +5 -0
  420. package/bin/Utils/Logger/index.js.map +1 -0
  421. package/bin/Utils/PerformanceMonitor.d.ts +196 -0
  422. package/bin/Utils/PerformanceMonitor.d.ts.map +1 -0
  423. package/bin/Utils/PerformanceMonitor.js +244 -0
  424. package/bin/Utils/PerformanceMonitor.js.map +1 -0
  425. package/bin/Utils/Pool/IPoolable.d.ts +29 -0
  426. package/bin/Utils/Pool/IPoolable.d.ts.map +1 -0
  427. package/bin/Utils/Pool/IPoolable.js +2 -0
  428. package/bin/Utils/Pool/IPoolable.js.map +1 -0
  429. package/bin/Utils/Pool/Pool.d.ts +109 -0
  430. package/bin/Utils/Pool/Pool.d.ts.map +1 -0
  431. package/bin/Utils/Pool/Pool.js +238 -0
  432. package/bin/Utils/Pool/Pool.js.map +1 -0
  433. package/bin/Utils/Pool/PoolManager.d.ts +96 -0
  434. package/bin/Utils/Pool/PoolManager.d.ts.map +1 -0
  435. package/bin/Utils/Pool/PoolManager.js +199 -0
  436. package/bin/Utils/Pool/PoolManager.js.map +1 -0
  437. package/bin/Utils/Pool/index.d.ts +4 -0
  438. package/bin/Utils/Pool/index.d.ts.map +1 -0
  439. package/bin/Utils/Pool/index.js +4 -0
  440. package/bin/Utils/Pool/index.js.map +1 -0
  441. package/bin/Utils/Profiler/AutoProfiler.d.ts +160 -0
  442. package/bin/Utils/Profiler/AutoProfiler.d.ts.map +1 -0
  443. package/bin/Utils/Profiler/AutoProfiler.js +503 -0
  444. package/bin/Utils/Profiler/AutoProfiler.js.map +1 -0
  445. package/bin/Utils/Profiler/ProfilerSDK.d.ts +175 -0
  446. package/bin/Utils/Profiler/ProfilerSDK.d.ts.map +1 -0
  447. package/bin/Utils/Profiler/ProfilerSDK.js +727 -0
  448. package/bin/Utils/Profiler/ProfilerSDK.js.map +1 -0
  449. package/bin/Utils/Profiler/ProfilerTypes.d.ts +218 -0
  450. package/bin/Utils/Profiler/ProfilerTypes.d.ts.map +1 -0
  451. package/bin/Utils/Profiler/ProfilerTypes.js +47 -0
  452. package/bin/Utils/Profiler/ProfilerTypes.js.map +1 -0
  453. package/bin/Utils/Profiler/index.d.ts +8 -0
  454. package/bin/Utils/Profiler/index.d.ts.map +1 -0
  455. package/bin/Utils/Profiler/index.js +7 -0
  456. package/bin/Utils/Profiler/index.js.map +1 -0
  457. package/bin/Utils/Time.d.ts +47 -0
  458. package/bin/Utils/Time.d.ts.map +1 -0
  459. package/bin/Utils/Time.js +64 -0
  460. package/bin/Utils/Time.js.map +1 -0
  461. package/bin/Utils/Timers/ITimer.d.ts +16 -0
  462. package/bin/Utils/Timers/ITimer.d.ts.map +1 -0
  463. package/bin/Utils/Timers/ITimer.js +2 -0
  464. package/bin/Utils/Timers/ITimer.js.map +1 -0
  465. package/bin/Utils/Timers/Timer.d.ts +30 -0
  466. package/bin/Utils/Timers/Timer.d.ts.map +1 -0
  467. package/bin/Utils/Timers/Timer.js +58 -0
  468. package/bin/Utils/Timers/Timer.js.map +1 -0
  469. package/bin/Utils/Timers/TimerManager.d.ts +26 -0
  470. package/bin/Utils/Timers/TimerManager.d.ts.map +1 -0
  471. package/bin/Utils/Timers/TimerManager.js +48 -0
  472. package/bin/Utils/Timers/TimerManager.js.map +1 -0
  473. package/bin/Utils/index.d.ts +11 -0
  474. package/bin/Utils/index.d.ts.map +1 -0
  475. package/bin/Utils/index.js +11 -0
  476. package/bin/Utils/index.js.map +1 -0
  477. package/bin/index.d.ts +29 -0
  478. package/bin/index.d.ts.map +1 -0
  479. package/bin/index.js +36 -0
  480. package/bin/index.js.map +1 -0
  481. package/package.json +84 -47
  482. package/index.cjs +0 -2
  483. package/index.cjs.map +0 -1
  484. package/index.d.ts +0 -13129
  485. package/index.es5.js +0 -4
  486. package/index.es5.js.map +0 -1
  487. package/index.mjs +0 -2
  488. package/index.mjs.map +0 -1
  489. package/index.umd.js +0 -4
  490. package/index.umd.js.map +0 -1
@@ -0,0 +1,206 @@
1
+ /**
2
+ * 依赖注入装饰器
3
+ *
4
+ * 提供 @Injectable、@InjectProperty 和 @Updatable 装饰器,用于标记可注入的类和依赖注入点
5
+ */
6
+ import type { ServiceContainer } from '../ServiceContainer';
7
+ import type { IService, ServiceType } from '../ServiceContainer';
8
+ /**
9
+ * 依赖注入元数据存储
10
+ */
11
+ type Constructor = abstract new (...args: unknown[]) => unknown;
12
+ /**
13
+ * 可注入元数据接口
14
+ */
15
+ export interface InjectableMetadata {
16
+ /**
17
+ * 是否可注入
18
+ */
19
+ injectable: boolean;
20
+ /**
21
+ * 依赖列表
22
+ */
23
+ dependencies: Array<ServiceType<IService> | string | symbol>;
24
+ /**
25
+ * 属性注入映射
26
+ * key: 属性名, value: 服务类型
27
+ */
28
+ properties?: Map<string | symbol, ServiceType<IService>>;
29
+ }
30
+ /**
31
+ * 可更新元数据接口
32
+ */
33
+ export interface UpdatableMetadata {
34
+ /**
35
+ * 是否可更新
36
+ */
37
+ updatable: boolean;
38
+ /**
39
+ * 更新优先级(数值越小越先执行,默认0)
40
+ */
41
+ priority: number;
42
+ }
43
+ /**
44
+ * @Injectable() 装饰器
45
+ *
46
+ * 标记类为可注入的服务,使其可以通过ServiceContainer进行依赖注入
47
+ *
48
+ * @example
49
+ * ```typescript
50
+ * @Injectable()
51
+ * class TimeService implements IService {
52
+ * constructor() {}
53
+ * dispose() {}
54
+ * }
55
+ *
56
+ * @Injectable()
57
+ * class PhysicsSystem extends EntitySystem {
58
+ * @InjectProperty(TimeService)
59
+ * private timeService!: TimeService;
60
+ *
61
+ * constructor() {
62
+ * super(Matcher.empty());
63
+ * }
64
+ * }
65
+ * ```
66
+ */
67
+ export declare function Injectable(): ClassDecorator;
68
+ /**
69
+ * @Updatable() 装饰器
70
+ *
71
+ * 标记服务类为可更新的,使其在每帧自动被ServiceContainer调用update方法。
72
+ * 使用此装饰器的类必须实现IUpdatable接口(包含update方法)。
73
+ *
74
+ * @param priority - 更新优先级(数值越小越先执行,默认0)
75
+ * @throws 如果类没有实现update方法,将在运行时抛出错误
76
+ *
77
+ * @example
78
+ * ```typescript
79
+ * @Injectable()
80
+ * @Updatable()
81
+ * class TimerManager implements IService, IUpdatable {
82
+ * update(deltaTime?: number) {
83
+ * // 每帧更新逻辑
84
+ * }
85
+ * dispose() {}
86
+ * }
87
+ *
88
+ * // 指定优先级
89
+ * @Injectable()
90
+ * @Updatable(10)
91
+ * class PhysicsManager implements IService, IUpdatable {
92
+ * update() { }
93
+ * dispose() {}
94
+ * }
95
+ * ```
96
+ */
97
+ export declare function Updatable(priority?: number): ClassDecorator;
98
+ /**
99
+ * @InjectProperty() 装饰器
100
+ *
101
+ * 通过属性装饰器注入依赖
102
+ *
103
+ * 注入时机:在构造函数执行后、onInitialize() 调用前完成
104
+ *
105
+ * @param serviceType 服务类型
106
+ *
107
+ * @example
108
+ * ```typescript
109
+ * @Injectable()
110
+ * class PhysicsSystem extends EntitySystem {
111
+ * @InjectProperty(TimeService)
112
+ * private timeService!: TimeService;
113
+ *
114
+ * @InjectProperty(CollisionService)
115
+ * private collision!: CollisionService;
116
+ *
117
+ * constructor() {
118
+ * super(Matcher.empty());
119
+ * }
120
+ *
121
+ * public onInitialize(): void {
122
+ * // 此时属性已注入完成,可以安全使用
123
+ * console.log(this.timeService.getDeltaTime());
124
+ * }
125
+ * }
126
+ * ```
127
+ */
128
+ export declare function InjectProperty(serviceType: ServiceType<IService>): PropertyDecorator;
129
+ /**
130
+ * 检查类是否标记为可注入
131
+ *
132
+ * @param target 目标类
133
+ * @returns 是否可注入
134
+ */
135
+ export declare function isInjectable(target: Constructor): boolean;
136
+ /**
137
+ * 获取类的依赖注入元数据
138
+ *
139
+ * @param target 目标类
140
+ * @returns 依赖注入元数据
141
+ */
142
+ export declare function getInjectableMetadata(target: Constructor): InjectableMetadata | undefined;
143
+ /**
144
+ * 获取属性注入元数据
145
+ *
146
+ * @param target 目标类
147
+ * @returns 属性名到服务类型的映射
148
+ */
149
+ export declare function getPropertyInjectMetadata(target: Constructor): Map<string | symbol, ServiceType<IService>>;
150
+ /**
151
+ * 创建实例并自动注入依赖
152
+ *
153
+ * @param constructor 构造函数
154
+ * @param container 服务容器
155
+ * @returns 创建的实例
156
+ *
157
+ * @example
158
+ * ```typescript
159
+ * const instance = createInstance(MySystem, container);
160
+ * ```
161
+ */
162
+ export declare function createInstance<T>(constructor: new (...args: any[]) => T, container: ServiceContainer): T;
163
+ /**
164
+ * 为实例注入属性依赖
165
+ *
166
+ * @param instance 目标实例
167
+ * @param container 服务容器
168
+ */
169
+ export declare function injectProperties<T extends object>(instance: T, container: ServiceContainer): void;
170
+ /**
171
+ * 检查类是否标记为可更新
172
+ *
173
+ * @param target 目标类
174
+ * @returns 是否可更新
175
+ */
176
+ export declare function isUpdatable(target: Constructor): boolean;
177
+ /**
178
+ * 获取类的可更新元数据
179
+ *
180
+ * @param target 目标类
181
+ * @returns 可更新元数据
182
+ */
183
+ export declare function getUpdatableMetadata(target: Constructor): UpdatableMetadata | undefined;
184
+ /**
185
+ * 注册可注入的服务到容器
186
+ *
187
+ * 自动检测@Injectable装饰器并注册服务
188
+ *
189
+ * @param container 服务容器
190
+ * @param serviceType 服务类型
191
+ * @param singleton 是否注册为单例(默认true)
192
+ *
193
+ * @example
194
+ * ```typescript
195
+ * @Injectable()
196
+ * class MyService implements IService {
197
+ * dispose() {}
198
+ * }
199
+ *
200
+ * // 自动注册
201
+ * registerInjectable(Core.services, MyService);
202
+ * ```
203
+ */
204
+ export declare function registerInjectable<T extends IService>(container: ServiceContainer, serviceType: ServiceType<T>, singleton?: boolean): void;
205
+ export {};
206
+ //# sourceMappingURL=Decorators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Decorators.d.ts","sourceRoot":"","sources":["../../../src/Core/DI/Decorators.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEjE;;GAEG;AACH,KAAK,WAAW,GAAG,QAAQ,MAAM,GAAG,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C,EACtC,SAAS,EAAE,gBAAgB,GAC5B,CAAC,CAQH;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,SAAS,EAAE,gBAAgB,GAAG,IAAI,CAejG;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAGxD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,GAAG,iBAAiB,GAAG,SAAS,CAEvF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,QAAQ,EACjD,SAAS,EAAE,gBAAgB,EAC3B,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC,EAC3B,SAAS,GAAE,OAAc,GAC1B,IAAI,CAiBN"}
@@ -0,0 +1,253 @@
1
+ /**
2
+ * 依赖注入装饰器
3
+ *
4
+ * 提供 @Injectable、@InjectProperty 和 @Updatable 装饰器,用于标记可注入的类和依赖注入点
5
+ */
6
+ const injectableMetadata = new WeakMap();
7
+ const updatableMetadata = new WeakMap();
8
+ /**
9
+ * @Injectable() 装饰器
10
+ *
11
+ * 标记类为可注入的服务,使其可以通过ServiceContainer进行依赖注入
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * @Injectable()
16
+ * class TimeService implements IService {
17
+ * constructor() {}
18
+ * dispose() {}
19
+ * }
20
+ *
21
+ * @Injectable()
22
+ * class PhysicsSystem extends EntitySystem {
23
+ * @InjectProperty(TimeService)
24
+ * private timeService!: TimeService;
25
+ *
26
+ * constructor() {
27
+ * super(Matcher.empty());
28
+ * }
29
+ * }
30
+ * ```
31
+ */
32
+ export function Injectable() {
33
+ return function (target) {
34
+ const existing = injectableMetadata.get(target);
35
+ injectableMetadata.set(target, {
36
+ injectable: true,
37
+ dependencies: [],
38
+ ...(existing?.properties && { properties: existing.properties })
39
+ });
40
+ };
41
+ }
42
+ /**
43
+ * @Updatable() 装饰器
44
+ *
45
+ * 标记服务类为可更新的,使其在每帧自动被ServiceContainer调用update方法。
46
+ * 使用此装饰器的类必须实现IUpdatable接口(包含update方法)。
47
+ *
48
+ * @param priority - 更新优先级(数值越小越先执行,默认0)
49
+ * @throws 如果类没有实现update方法,将在运行时抛出错误
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * @Injectable()
54
+ * @Updatable()
55
+ * class TimerManager implements IService, IUpdatable {
56
+ * update(deltaTime?: number) {
57
+ * // 每帧更新逻辑
58
+ * }
59
+ * dispose() {}
60
+ * }
61
+ *
62
+ * // 指定优先级
63
+ * @Injectable()
64
+ * @Updatable(10)
65
+ * class PhysicsManager implements IService, IUpdatable {
66
+ * update() { }
67
+ * dispose() {}
68
+ * }
69
+ * ```
70
+ */
71
+ export function Updatable(priority = 0) {
72
+ return function (target) {
73
+ // 验证类原型上是否有update方法
74
+ const prototype = target.prototype;
75
+ if (!prototype || typeof prototype.update !== 'function') {
76
+ throw new Error(`@Updatable() decorator requires class ${target.name} to implement IUpdatable interface with update() method. ` +
77
+ 'Please add \'implements IUpdatable\' and define update(deltaTime?: number): void method.');
78
+ }
79
+ // 标记为可更新
80
+ updatableMetadata.set(target, {
81
+ updatable: true,
82
+ priority
83
+ });
84
+ };
85
+ }
86
+ /**
87
+ * @InjectProperty() 装饰器
88
+ *
89
+ * 通过属性装饰器注入依赖
90
+ *
91
+ * 注入时机:在构造函数执行后、onInitialize() 调用前完成
92
+ *
93
+ * @param serviceType 服务类型
94
+ *
95
+ * @example
96
+ * ```typescript
97
+ * @Injectable()
98
+ * class PhysicsSystem extends EntitySystem {
99
+ * @InjectProperty(TimeService)
100
+ * private timeService!: TimeService;
101
+ *
102
+ * @InjectProperty(CollisionService)
103
+ * private collision!: CollisionService;
104
+ *
105
+ * constructor() {
106
+ * super(Matcher.empty());
107
+ * }
108
+ *
109
+ * public onInitialize(): void {
110
+ * // 此时属性已注入完成,可以安全使用
111
+ * console.log(this.timeService.getDeltaTime());
112
+ * }
113
+ * }
114
+ * ```
115
+ */
116
+ export function InjectProperty(serviceType) {
117
+ return function (target, propertyKey) {
118
+ let metadata = injectableMetadata.get(target.constructor);
119
+ if (!metadata) {
120
+ metadata = {
121
+ injectable: true,
122
+ dependencies: []
123
+ };
124
+ injectableMetadata.set(target.constructor, metadata);
125
+ }
126
+ if (!metadata.properties) {
127
+ metadata.properties = new Map();
128
+ }
129
+ metadata.properties.set(propertyKey, serviceType);
130
+ };
131
+ }
132
+ /**
133
+ * 检查类是否标记为可注入
134
+ *
135
+ * @param target 目标类
136
+ * @returns 是否可注入
137
+ */
138
+ export function isInjectable(target) {
139
+ const metadata = injectableMetadata.get(target);
140
+ return metadata?.injectable ?? false;
141
+ }
142
+ /**
143
+ * 获取类的依赖注入元数据
144
+ *
145
+ * @param target 目标类
146
+ * @returns 依赖注入元数据
147
+ */
148
+ export function getInjectableMetadata(target) {
149
+ return injectableMetadata.get(target);
150
+ }
151
+ /**
152
+ * 获取属性注入元数据
153
+ *
154
+ * @param target 目标类
155
+ * @returns 属性名到服务类型的映射
156
+ */
157
+ export function getPropertyInjectMetadata(target) {
158
+ const metadata = injectableMetadata.get(target);
159
+ return metadata?.properties || new Map();
160
+ }
161
+ /**
162
+ * 创建实例并自动注入依赖
163
+ *
164
+ * @param constructor 构造函数
165
+ * @param container 服务容器
166
+ * @returns 创建的实例
167
+ *
168
+ * @example
169
+ * ```typescript
170
+ * const instance = createInstance(MySystem, container);
171
+ * ```
172
+ */
173
+ export function createInstance(constructor, container) {
174
+ // 创建实例(无参数注入)
175
+ const instance = new constructor();
176
+ // 注入属性依赖
177
+ injectProperties(instance, container);
178
+ return instance;
179
+ }
180
+ /**
181
+ * 为实例注入属性依赖
182
+ *
183
+ * @param instance 目标实例
184
+ * @param container 服务容器
185
+ */
186
+ export function injectProperties(instance, container) {
187
+ const constructor = instance.constructor;
188
+ const metadata = getInjectableMetadata(constructor);
189
+ if (!metadata?.properties || metadata.properties.size === 0) {
190
+ return;
191
+ }
192
+ for (const [propertyKey, serviceType] of metadata.properties) {
193
+ const service = container.resolve(serviceType);
194
+ if (service !== null) {
195
+ instance[propertyKey] = service;
196
+ }
197
+ }
198
+ }
199
+ /**
200
+ * 检查类是否标记为可更新
201
+ *
202
+ * @param target 目标类
203
+ * @returns 是否可更新
204
+ */
205
+ export function isUpdatable(target) {
206
+ const metadata = updatableMetadata.get(target);
207
+ return metadata?.updatable ?? false;
208
+ }
209
+ /**
210
+ * 获取类的可更新元数据
211
+ *
212
+ * @param target 目标类
213
+ * @returns 可更新元数据
214
+ */
215
+ export function getUpdatableMetadata(target) {
216
+ return updatableMetadata.get(target);
217
+ }
218
+ /**
219
+ * 注册可注入的服务到容器
220
+ *
221
+ * 自动检测@Injectable装饰器并注册服务
222
+ *
223
+ * @param container 服务容器
224
+ * @param serviceType 服务类型
225
+ * @param singleton 是否注册为单例(默认true)
226
+ *
227
+ * @example
228
+ * ```typescript
229
+ * @Injectable()
230
+ * class MyService implements IService {
231
+ * dispose() {}
232
+ * }
233
+ *
234
+ * // 自动注册
235
+ * registerInjectable(Core.services, MyService);
236
+ * ```
237
+ */
238
+ export function registerInjectable(container, serviceType, singleton = true) {
239
+ if (!isInjectable(serviceType)) {
240
+ throw new Error(`${serviceType.name} is not marked as @Injectable(). ` +
241
+ 'Please add @Injectable() decorator to the class.');
242
+ }
243
+ // 创建工厂函数,使用createInstance自动解析依赖
244
+ const factory = (c) => createInstance(serviceType, c);
245
+ // 注册到容器
246
+ if (singleton) {
247
+ container.registerSingleton(serviceType, factory);
248
+ }
249
+ else {
250
+ container.registerTransient(serviceType, factory);
251
+ }
252
+ }
253
+ //# sourceMappingURL=Decorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Decorators.js","sourceRoot":"","sources":["../../../src/Core/DI/Decorators.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAmC,CAAC;AAC1E,MAAM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CAAC;QACJ,SAAS,CAAC,iBAAiB,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;AACL,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 依赖注入模块
3
+ *
4
+ * 提供装饰器和工具函数,用于实现依赖注入模式
5
+ */
6
+ export { Injectable, InjectProperty, Updatable, isInjectable, getInjectableMetadata, getPropertyInjectMetadata, isUpdatable, getUpdatableMetadata, createInstance, injectProperties, registerInjectable } from './Decorators';
7
+ export type { InjectableMetadata, UpdatableMetadata } from './Decorators';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Core/DI/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACH,UAAU,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,EACzB,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EACrB,MAAM,cAAc,CAAC;AAEtB,YAAY,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 依赖注入模块
3
+ *
4
+ * 提供装饰器和工具函数,用于实现依赖注入模式
5
+ */
6
+ export { Injectable, InjectProperty, Updatable, isInjectable, getInjectableMetadata, getPropertyInjectMetadata, isUpdatable, getUpdatableMetadata, createInstance, injectProperties, registerInjectable } from './Decorators';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Core/DI/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACH,UAAU,EACV,cAAc,EACd,SAAS,EACT,YAAY,EACZ,qBAAqB,EACrB,yBAAyB,EACzB,WAAW,EACX,oBAAoB,EACpB,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EACrB,MAAM,cAAc,CAAC"}
@@ -0,0 +1,112 @@
1
+ import type { Core } from '../Core';
2
+ import type { ServiceContainer } from './ServiceContainer';
3
+ /**
4
+ * 插件状态
5
+ */
6
+ export declare enum PluginState {
7
+ /**
8
+ * 未安装
9
+ */
10
+ NotInstalled = "not_installed",
11
+ /**
12
+ * 已安装
13
+ */
14
+ Installed = "installed",
15
+ /**
16
+ * 安装失败
17
+ */
18
+ Failed = "failed"
19
+ }
20
+ /**
21
+ * 插件接口
22
+ *
23
+ * 所有插件都必须实现此接口。
24
+ * 插件提供了一种扩展框架功能的标准方式。
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * class MyPlugin implements IPlugin {
29
+ * readonly name = 'my-plugin';
30
+ * readonly version = '1.0.0';
31
+ * readonly dependencies = ['other-plugin'];
32
+ *
33
+ * async install(core: Core, services: ServiceContainer) {
34
+ * // 注册服务
35
+ * services.registerSingleton(MyService);
36
+ *
37
+ * // 添加系统
38
+ * const world = core.getWorld();
39
+ * if (world) {
40
+ * world.addSystem(new MySystem());
41
+ * }
42
+ * }
43
+ *
44
+ * async uninstall() {
45
+ * // 清理资源
46
+ * }
47
+ * }
48
+ * ```
49
+ */
50
+ export interface IPlugin {
51
+ /**
52
+ * 插件唯一名称
53
+ *
54
+ * 用于依赖解析和插件管理。
55
+ */
56
+ readonly name: string;
57
+ /**
58
+ * 插件版本
59
+ *
60
+ * 遵循语义化版本规范 (semver)。
61
+ */
62
+ readonly version: string;
63
+ /**
64
+ * 依赖的其他插件名称列表
65
+ *
66
+ * 这些插件必须在当前插件之前安装。
67
+ */
68
+ readonly dependencies?: readonly string[];
69
+ /**
70
+ * 安装插件
71
+ *
72
+ * 在此方法中初始化插件,注册服务、系统等。
73
+ * 可以是同步或异步的。
74
+ *
75
+ * @param core - Core实例,用于访问World等
76
+ * @param services - 服务容器,用于注册服务
77
+ */
78
+ install(core: Core, services: ServiceContainer): void | Promise<void>;
79
+ /**
80
+ * 卸载插件
81
+ *
82
+ * 清理插件占用的资源。
83
+ * 可以是同步或异步的。
84
+ */
85
+ uninstall(): void | Promise<void>;
86
+ }
87
+ /**
88
+ * 插件元数据
89
+ */
90
+ export interface IPluginMetadata {
91
+ /**
92
+ * 插件名称
93
+ */
94
+ name: string;
95
+ /**
96
+ * 插件版本
97
+ */
98
+ version: string;
99
+ /**
100
+ * 插件状态
101
+ */
102
+ state: PluginState;
103
+ /**
104
+ * 安装时间戳
105
+ */
106
+ installedAt?: number;
107
+ /**
108
+ * 错误信息(如果安装失败)
109
+ */
110
+ error?: string;
111
+ }
112
+ //# sourceMappingURL=Plugin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Core/Plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;GAEG;AACH,oBAAY,WAAW;IACnB;;OAEG;IACH,YAAY,kBAAkB;IAE9B;;OAEG;IACH,SAAS,cAAc;IAEvB;;OAEG;IACH,MAAM,WAAW;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,WAAW,OAAO;IACpB;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAE1C;;;;;;;;OAQG;IACH,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtE;;;;;OAKG;IACH,SAAS,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,WAAW,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * 插件状态
3
+ */
4
+ export var PluginState;
5
+ (function (PluginState) {
6
+ /**
7
+ * 未安装
8
+ */
9
+ PluginState["NotInstalled"] = "not_installed";
10
+ /**
11
+ * 已安装
12
+ */
13
+ PluginState["Installed"] = "installed";
14
+ /**
15
+ * 安装失败
16
+ */
17
+ PluginState["Failed"] = "failed";
18
+ })(PluginState || (PluginState = {}));
19
+ //# sourceMappingURL=Plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Plugin.js","sourceRoot":"","sources":["../../src/Core/Plugin.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAN,IAAY,WAeX;AAfD,WAAY,WAAW;IACnB;;OAEG;IACH,6CAA8B,CAAA;IAE9B;;OAEG;IACH,sCAAuB,CAAA;IAEvB;;OAEG;IACH,gCAAiB,CAAA;AACrB,CAAC,EAfW,WAAW,KAAX,WAAW,QAetB"}