@esengine/ecs-framework 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (491) hide show
  1. package/dist/index.cjs +2 -0
  2. package/dist/index.cjs.map +1 -0
  3. package/dist/index.d.ts +13451 -0
  4. package/dist/index.es5.js +4 -0
  5. package/dist/index.es5.js.map +1 -0
  6. package/dist/index.mjs +2 -0
  7. package/dist/index.mjs.map +1 -0
  8. package/dist/index.umd.js +4 -0
  9. package/dist/index.umd.js.map +1 -0
  10. package/dist/package.json +47 -0
  11. package/package.json +87 -84
  12. package/bin/Core/DI/Decorators.d.ts +0 -206
  13. package/bin/Core/DI/Decorators.d.ts.map +0 -1
  14. package/bin/Core/DI/Decorators.js +0 -253
  15. package/bin/Core/DI/Decorators.js.map +0 -1
  16. package/bin/Core/DI/index.d.ts +0 -8
  17. package/bin/Core/DI/index.d.ts.map +0 -1
  18. package/bin/Core/DI/index.js +0 -7
  19. package/bin/Core/DI/index.js.map +0 -1
  20. package/bin/Core/Plugin.d.ts +0 -112
  21. package/bin/Core/Plugin.d.ts.map +0 -1
  22. package/bin/Core/Plugin.js +0 -19
  23. package/bin/Core/Plugin.js.map +0 -1
  24. package/bin/Core/PluginManager.d.ts +0 -118
  25. package/bin/Core/PluginManager.d.ts.map +0 -1
  26. package/bin/Core/PluginManager.js +0 -229
  27. package/bin/Core/PluginManager.js.map +0 -1
  28. package/bin/Core/ServiceContainer.d.ts +0 -221
  29. package/bin/Core/ServiceContainer.d.ts.map +0 -1
  30. package/bin/Core/ServiceContainer.js +0 -352
  31. package/bin/Core/ServiceContainer.js.map +0 -1
  32. package/bin/Core.d.ts +0 -379
  33. package/bin/Core.d.ts.map +0 -1
  34. package/bin/Core.js +0 -553
  35. package/bin/Core.js.map +0 -1
  36. package/bin/ECS/Component.d.ts +0 -104
  37. package/bin/ECS/Component.d.ts.map +0 -1
  38. package/bin/ECS/Component.js +0 -105
  39. package/bin/ECS/Component.js.map +0 -1
  40. package/bin/ECS/Components/HierarchyComponent.d.ts +0 -46
  41. package/bin/ECS/Components/HierarchyComponent.d.ts.map +0 -1
  42. package/bin/ECS/Components/HierarchyComponent.js +0 -65
  43. package/bin/ECS/Components/HierarchyComponent.js.map +0 -1
  44. package/bin/ECS/Components/index.d.ts +0 -2
  45. package/bin/ECS/Components/index.d.ts.map +0 -1
  46. package/bin/ECS/Components/index.js +0 -2
  47. package/bin/ECS/Components/index.js.map +0 -1
  48. package/bin/ECS/Core/ArchetypeSystem.d.ts +0 -103
  49. package/bin/ECS/Core/ArchetypeSystem.d.ts.map +0 -1
  50. package/bin/ECS/Core/ArchetypeSystem.js +0 -244
  51. package/bin/ECS/Core/ArchetypeSystem.js.map +0 -1
  52. package/bin/ECS/Core/CommandBuffer.d.ts +0 -154
  53. package/bin/ECS/Core/CommandBuffer.d.ts.map +0 -1
  54. package/bin/ECS/Core/CommandBuffer.js +0 -244
  55. package/bin/ECS/Core/CommandBuffer.js.map +0 -1
  56. package/bin/ECS/Core/ComponentPool.d.ts +0 -139
  57. package/bin/ECS/Core/ComponentPool.d.ts.map +0 -1
  58. package/bin/ECS/Core/ComponentPool.js +0 -276
  59. package/bin/ECS/Core/ComponentPool.js.map +0 -1
  60. package/bin/ECS/Core/ComponentStorage/ComponentRegistry.d.ts +0 -127
  61. package/bin/ECS/Core/ComponentStorage/ComponentRegistry.d.ts.map +0 -1
  62. package/bin/ECS/Core/ComponentStorage/ComponentRegistry.js +0 -235
  63. package/bin/ECS/Core/ComponentStorage/ComponentRegistry.js.map +0 -1
  64. package/bin/ECS/Core/ComponentStorage.d.ts +0 -185
  65. package/bin/ECS/Core/ComponentStorage.d.ts.map +0 -1
  66. package/bin/ECS/Core/ComponentStorage.js +0 -321
  67. package/bin/ECS/Core/ComponentStorage.js.map +0 -1
  68. package/bin/ECS/Core/EntityLifecyclePolicy.d.ts +0 -26
  69. package/bin/ECS/Core/EntityLifecyclePolicy.d.ts.map +0 -1
  70. package/bin/ECS/Core/EntityLifecyclePolicy.js +0 -2
  71. package/bin/ECS/Core/EntityLifecyclePolicy.js.map +0 -1
  72. package/bin/ECS/Core/EventBus.d.ts +0 -210
  73. package/bin/ECS/Core/EventBus.d.ts.map +0 -1
  74. package/bin/ECS/Core/EventBus.js +0 -370
  75. package/bin/ECS/Core/EventBus.js.map +0 -1
  76. package/bin/ECS/Core/EventSystem.d.ts +0 -225
  77. package/bin/ECS/Core/EventSystem.d.ts.map +0 -1
  78. package/bin/ECS/Core/EventSystem.js +0 -448
  79. package/bin/ECS/Core/EventSystem.js.map +0 -1
  80. package/bin/ECS/Core/Events/index.d.ts +0 -3
  81. package/bin/ECS/Core/Events/index.d.ts.map +0 -1
  82. package/bin/ECS/Core/Events/index.js +0 -3
  83. package/bin/ECS/Core/Events/index.js.map +0 -1
  84. package/bin/ECS/Core/FluentAPI/ComponentBuilder.d.ts +0 -35
  85. package/bin/ECS/Core/FluentAPI/ComponentBuilder.d.ts.map +0 -1
  86. package/bin/ECS/Core/FluentAPI/ComponentBuilder.js +0 -48
  87. package/bin/ECS/Core/FluentAPI/ComponentBuilder.js.map +0 -1
  88. package/bin/ECS/Core/FluentAPI/ECSFluentAPI.d.ts +0 -135
  89. package/bin/ECS/Core/FluentAPI/ECSFluentAPI.d.ts.map +0 -1
  90. package/bin/ECS/Core/FluentAPI/ECSFluentAPI.js +0 -166
  91. package/bin/ECS/Core/FluentAPI/ECSFluentAPI.js.map +0 -1
  92. package/bin/ECS/Core/FluentAPI/EntityBatchOperator.d.ts +0 -58
  93. package/bin/ECS/Core/FluentAPI/EntityBatchOperator.d.ts.map +0 -1
  94. package/bin/ECS/Core/FluentAPI/EntityBatchOperator.js +0 -85
  95. package/bin/ECS/Core/FluentAPI/EntityBatchOperator.js.map +0 -1
  96. package/bin/ECS/Core/FluentAPI/EntityBuilder.d.ts +0 -110
  97. package/bin/ECS/Core/FluentAPI/EntityBuilder.d.ts.map +0 -1
  98. package/bin/ECS/Core/FluentAPI/EntityBuilder.js +0 -181
  99. package/bin/ECS/Core/FluentAPI/EntityBuilder.js.map +0 -1
  100. package/bin/ECS/Core/FluentAPI/SceneBuilder.d.ts +0 -53
  101. package/bin/ECS/Core/FluentAPI/SceneBuilder.d.ts.map +0 -1
  102. package/bin/ECS/Core/FluentAPI/SceneBuilder.js +0 -79
  103. package/bin/ECS/Core/FluentAPI/SceneBuilder.js.map +0 -1
  104. package/bin/ECS/Core/FluentAPI/index.d.ts +0 -6
  105. package/bin/ECS/Core/FluentAPI/index.d.ts.map +0 -1
  106. package/bin/ECS/Core/FluentAPI/index.js +0 -6
  107. package/bin/ECS/Core/FluentAPI/index.js.map +0 -1
  108. package/bin/ECS/Core/FluentAPI.d.ts +0 -2
  109. package/bin/ECS/Core/FluentAPI.d.ts.map +0 -1
  110. package/bin/ECS/Core/FluentAPI.js +0 -3
  111. package/bin/ECS/Core/FluentAPI.js.map +0 -1
  112. package/bin/ECS/Core/Query/TypedQuery.d.ts +0 -214
  113. package/bin/ECS/Core/Query/TypedQuery.d.ts.map +0 -1
  114. package/bin/ECS/Core/Query/TypedQuery.js +0 -294
  115. package/bin/ECS/Core/Query/TypedQuery.js.map +0 -1
  116. package/bin/ECS/Core/Query/index.d.ts +0 -3
  117. package/bin/ECS/Core/Query/index.d.ts.map +0 -1
  118. package/bin/ECS/Core/Query/index.js +0 -3
  119. package/bin/ECS/Core/Query/index.js.map +0 -1
  120. package/bin/ECS/Core/QuerySystem.d.ts +0 -458
  121. package/bin/ECS/Core/QuerySystem.d.ts.map +0 -1
  122. package/bin/ECS/Core/QuerySystem.js +0 -1069
  123. package/bin/ECS/Core/QuerySystem.js.map +0 -1
  124. package/bin/ECS/Core/QueryTypes.d.ts +0 -34
  125. package/bin/ECS/Core/QueryTypes.d.ts.map +0 -1
  126. package/bin/ECS/Core/QueryTypes.js +0 -13
  127. package/bin/ECS/Core/QueryTypes.js.map +0 -1
  128. package/bin/ECS/Core/ReactiveQuery.d.ts +0 -211
  129. package/bin/ECS/Core/ReactiveQuery.d.ts.map +0 -1
  130. package/bin/ECS/Core/ReactiveQuery.js +0 -401
  131. package/bin/ECS/Core/ReactiveQuery.js.map +0 -1
  132. package/bin/ECS/Core/ReferenceTracker.d.ts +0 -111
  133. package/bin/ECS/Core/ReferenceTracker.d.ts.map +0 -1
  134. package/bin/ECS/Core/ReferenceTracker.js +0 -254
  135. package/bin/ECS/Core/ReferenceTracker.js.map +0 -1
  136. package/bin/ECS/Core/SoASerializer.d.ts +0 -28
  137. package/bin/ECS/Core/SoASerializer.d.ts.map +0 -1
  138. package/bin/ECS/Core/SoASerializer.js +0 -85
  139. package/bin/ECS/Core/SoASerializer.js.map +0 -1
  140. package/bin/ECS/Core/SoAStorage.d.ts +0 -129
  141. package/bin/ECS/Core/SoAStorage.d.ts.map +0 -1
  142. package/bin/ECS/Core/SoAStorage.js +0 -685
  143. package/bin/ECS/Core/SoAStorage.js.map +0 -1
  144. package/bin/ECS/Core/SoATypeRegistry.d.ts +0 -50
  145. package/bin/ECS/Core/SoATypeRegistry.d.ts.map +0 -1
  146. package/bin/ECS/Core/SoATypeRegistry.js +0 -135
  147. package/bin/ECS/Core/SoATypeRegistry.js.map +0 -1
  148. package/bin/ECS/Core/Storage/index.d.ts +0 -4
  149. package/bin/ECS/Core/Storage/index.d.ts.map +0 -1
  150. package/bin/ECS/Core/Storage/index.js +0 -4
  151. package/bin/ECS/Core/Storage/index.js.map +0 -1
  152. package/bin/ECS/Core/StorageDecorators.d.ts +0 -20
  153. package/bin/ECS/Core/StorageDecorators.d.ts.map +0 -1
  154. package/bin/ECS/Core/StorageDecorators.js +0 -27
  155. package/bin/ECS/Core/StorageDecorators.js.map +0 -1
  156. package/bin/ECS/CoreEvents.d.ts +0 -131
  157. package/bin/ECS/CoreEvents.d.ts.map +0 -1
  158. package/bin/ECS/CoreEvents.js +0 -163
  159. package/bin/ECS/CoreEvents.js.map +0 -1
  160. package/bin/ECS/Decorators/EntityRefDecorator.d.ts +0 -46
  161. package/bin/ECS/Decorators/EntityRefDecorator.d.ts.map +0 -1
  162. package/bin/ECS/Decorators/EntityRefDecorator.js +0 -118
  163. package/bin/ECS/Decorators/EntityRefDecorator.js.map +0 -1
  164. package/bin/ECS/Decorators/PropertyDecorator.d.ts +0 -168
  165. package/bin/ECS/Decorators/PropertyDecorator.d.ts.map +0 -1
  166. package/bin/ECS/Decorators/PropertyDecorator.js +0 -40
  167. package/bin/ECS/Decorators/PropertyDecorator.js.map +0 -1
  168. package/bin/ECS/Decorators/TypeDecorators.d.ts +0 -124
  169. package/bin/ECS/Decorators/TypeDecorators.d.ts.map +0 -1
  170. package/bin/ECS/Decorators/TypeDecorators.js +0 -151
  171. package/bin/ECS/Decorators/TypeDecorators.js.map +0 -1
  172. package/bin/ECS/Decorators/index.d.ts +0 -7
  173. package/bin/ECS/Decorators/index.d.ts.map +0 -1
  174. package/bin/ECS/Decorators/index.js +0 -4
  175. package/bin/ECS/Decorators/index.js.map +0 -1
  176. package/bin/ECS/Entity.d.ts +0 -415
  177. package/bin/ECS/Entity.d.ts.map +0 -1
  178. package/bin/ECS/Entity.js +0 -683
  179. package/bin/ECS/Entity.js.map +0 -1
  180. package/bin/ECS/EntityTags.d.ts +0 -71
  181. package/bin/ECS/EntityTags.d.ts.map +0 -1
  182. package/bin/ECS/EntityTags.js +0 -82
  183. package/bin/ECS/EntityTags.js.map +0 -1
  184. package/bin/ECS/IScene.d.ts +0 -308
  185. package/bin/ECS/IScene.d.ts.map +0 -1
  186. package/bin/ECS/IScene.js +0 -2
  187. package/bin/ECS/IScene.js.map +0 -1
  188. package/bin/ECS/Scene.d.ts +0 -799
  189. package/bin/ECS/Scene.d.ts.map +0 -1
  190. package/bin/ECS/Scene.js +0 -1203
  191. package/bin/ECS/Scene.js.map +0 -1
  192. package/bin/ECS/SceneManager.d.ts +0 -197
  193. package/bin/ECS/SceneManager.d.ts.map +0 -1
  194. package/bin/ECS/SceneManager.js +0 -264
  195. package/bin/ECS/SceneManager.js.map +0 -1
  196. package/bin/ECS/Serialization/ComponentSerializer.d.ts +0 -106
  197. package/bin/ECS/Serialization/ComponentSerializer.d.ts.map +0 -1
  198. package/bin/ECS/Serialization/ComponentSerializer.js +0 -251
  199. package/bin/ECS/Serialization/ComponentSerializer.js.map +0 -1
  200. package/bin/ECS/Serialization/EntitySerializer.d.ts +0 -111
  201. package/bin/ECS/Serialization/EntitySerializer.d.ts.map +0 -1
  202. package/bin/ECS/Serialization/EntitySerializer.js +0 -155
  203. package/bin/ECS/Serialization/EntitySerializer.js.map +0 -1
  204. package/bin/ECS/Serialization/IncrementalSerializer.d.ts +0 -259
  205. package/bin/ECS/Serialization/IncrementalSerializer.d.ts.map +0 -1
  206. package/bin/ECS/Serialization/IncrementalSerializer.js +0 -500
  207. package/bin/ECS/Serialization/IncrementalSerializer.js.map +0 -1
  208. package/bin/ECS/Serialization/SceneSerializer.d.ts +0 -213
  209. package/bin/ECS/Serialization/SceneSerializer.d.ts.map +0 -1
  210. package/bin/ECS/Serialization/SceneSerializer.js +0 -387
  211. package/bin/ECS/Serialization/SceneSerializer.js.map +0 -1
  212. package/bin/ECS/Serialization/SerializationDecorators.d.ts +0 -136
  213. package/bin/ECS/Serialization/SerializationDecorators.d.ts.map +0 -1
  214. package/bin/ECS/Serialization/SerializationDecorators.js +0 -216
  215. package/bin/ECS/Serialization/SerializationDecorators.js.map +0 -1
  216. package/bin/ECS/Serialization/VersionMigration.d.ts +0 -156
  217. package/bin/ECS/Serialization/VersionMigration.d.ts.map +0 -1
  218. package/bin/ECS/Serialization/VersionMigration.js +0 -279
  219. package/bin/ECS/Serialization/VersionMigration.js.map +0 -1
  220. package/bin/ECS/Serialization/index.d.ts +0 -18
  221. package/bin/ECS/Serialization/index.d.ts.map +0 -1
  222. package/bin/ECS/Serialization/index.js +0 -18
  223. package/bin/ECS/Serialization/index.js.map +0 -1
  224. package/bin/ECS/Systems/EntityCache.d.ts +0 -114
  225. package/bin/ECS/Systems/EntityCache.d.ts.map +0 -1
  226. package/bin/ECS/Systems/EntityCache.js +0 -145
  227. package/bin/ECS/Systems/EntityCache.js.map +0 -1
  228. package/bin/ECS/Systems/EntitySystem.d.ts +0 -591
  229. package/bin/ECS/Systems/EntitySystem.d.ts.map +0 -1
  230. package/bin/ECS/Systems/EntitySystem.js +0 -1102
  231. package/bin/ECS/Systems/EntitySystem.js.map +0 -1
  232. package/bin/ECS/Systems/HierarchySystem.d.ts +0 -155
  233. package/bin/ECS/Systems/HierarchySystem.d.ts.map +0 -1
  234. package/bin/ECS/Systems/HierarchySystem.js +0 -498
  235. package/bin/ECS/Systems/HierarchySystem.js.map +0 -1
  236. package/bin/ECS/Systems/IntervalSystem.d.ts +0 -33
  237. package/bin/ECS/Systems/IntervalSystem.d.ts.map +0 -1
  238. package/bin/ECS/Systems/IntervalSystem.js +0 -50
  239. package/bin/ECS/Systems/IntervalSystem.js.map +0 -1
  240. package/bin/ECS/Systems/PassiveSystem.d.ts +0 -17
  241. package/bin/ECS/Systems/PassiveSystem.d.ts.map +0 -1
  242. package/bin/ECS/Systems/PassiveSystem.js +0 -19
  243. package/bin/ECS/Systems/PassiveSystem.js.map +0 -1
  244. package/bin/ECS/Systems/ProcessingSystem.d.ts +0 -21
  245. package/bin/ECS/Systems/ProcessingSystem.d.ts.map +0 -1
  246. package/bin/ECS/Systems/ProcessingSystem.js +0 -20
  247. package/bin/ECS/Systems/ProcessingSystem.js.map +0 -1
  248. package/bin/ECS/Systems/WorkerEntitySystem.d.ts +0 -313
  249. package/bin/ECS/Systems/WorkerEntitySystem.d.ts.map +0 -1
  250. package/bin/ECS/Systems/WorkerEntitySystem.js +0 -792
  251. package/bin/ECS/Systems/WorkerEntitySystem.js.map +0 -1
  252. package/bin/ECS/Systems/index.d.ts +0 -8
  253. package/bin/ECS/Systems/index.d.ts.map +0 -1
  254. package/bin/ECS/Systems/index.js +0 -8
  255. package/bin/ECS/Systems/index.js.map +0 -1
  256. package/bin/ECS/TypedEntity.d.ts +0 -192
  257. package/bin/ECS/TypedEntity.d.ts.map +0 -1
  258. package/bin/ECS/TypedEntity.js +0 -254
  259. package/bin/ECS/TypedEntity.js.map +0 -1
  260. package/bin/ECS/Utils/BigIntCompatibility.d.ts +0 -151
  261. package/bin/ECS/Utils/BigIntCompatibility.d.ts.map +0 -1
  262. package/bin/ECS/Utils/BigIntCompatibility.js +0 -476
  263. package/bin/ECS/Utils/BigIntCompatibility.js.map +0 -1
  264. package/bin/ECS/Utils/BitMaskHashMap.d.ts +0 -28
  265. package/bin/ECS/Utils/BitMaskHashMap.d.ts.map +0 -1
  266. package/bin/ECS/Utils/BitMaskHashMap.js +0 -127
  267. package/bin/ECS/Utils/BitMaskHashMap.js.map +0 -1
  268. package/bin/ECS/Utils/Bits.d.ts +0 -154
  269. package/bin/ECS/Utils/Bits.d.ts.map +0 -1
  270. package/bin/ECS/Utils/Bits.js +0 -331
  271. package/bin/ECS/Utils/Bits.js.map +0 -1
  272. package/bin/ECS/Utils/ComponentSparseSet.d.ts +0 -143
  273. package/bin/ECS/Utils/ComponentSparseSet.d.ts.map +0 -1
  274. package/bin/ECS/Utils/ComponentSparseSet.js +0 -347
  275. package/bin/ECS/Utils/ComponentSparseSet.js.map +0 -1
  276. package/bin/ECS/Utils/EntityList.d.ts +0 -115
  277. package/bin/ECS/Utils/EntityList.d.ts.map +0 -1
  278. package/bin/ECS/Utils/EntityList.js +0 -258
  279. package/bin/ECS/Utils/EntityList.js.map +0 -1
  280. package/bin/ECS/Utils/EntityProcessorList.d.ts +0 -56
  281. package/bin/ECS/Utils/EntityProcessorList.d.ts.map +0 -1
  282. package/bin/ECS/Utils/EntityProcessorList.js +0 -113
  283. package/bin/ECS/Utils/EntityProcessorList.js.map +0 -1
  284. package/bin/ECS/Utils/IdentifierPool.d.ts +0 -203
  285. package/bin/ECS/Utils/IdentifierPool.d.ts.map +0 -1
  286. package/bin/ECS/Utils/IdentifierPool.js +0 -325
  287. package/bin/ECS/Utils/IdentifierPool.js.map +0 -1
  288. package/bin/ECS/Utils/Matcher.d.ts +0 -171
  289. package/bin/ECS/Utils/Matcher.d.ts.map +0 -1
  290. package/bin/ECS/Utils/Matcher.js +0 -293
  291. package/bin/ECS/Utils/Matcher.js.map +0 -1
  292. package/bin/ECS/Utils/SparseSet.d.ts +0 -170
  293. package/bin/ECS/Utils/SparseSet.d.ts.map +0 -1
  294. package/bin/ECS/Utils/SparseSet.js +0 -280
  295. package/bin/ECS/Utils/SparseSet.js.map +0 -1
  296. package/bin/ECS/Utils/index.d.ts +0 -9
  297. package/bin/ECS/Utils/index.d.ts.map +0 -1
  298. package/bin/ECS/Utils/index.js +0 -10
  299. package/bin/ECS/Utils/index.js.map +0 -1
  300. package/bin/ECS/World.d.ts +0 -238
  301. package/bin/ECS/World.d.ts.map +0 -1
  302. package/bin/ECS/World.js +0 -416
  303. package/bin/ECS/World.js.map +0 -1
  304. package/bin/ECS/WorldManager.d.ts +0 -224
  305. package/bin/ECS/WorldManager.d.ts.map +0 -1
  306. package/bin/ECS/WorldManager.js +0 -365
  307. package/bin/ECS/WorldManager.js.map +0 -1
  308. package/bin/ECS/index.d.ts +0 -26
  309. package/bin/ECS/index.d.ts.map +0 -1
  310. package/bin/ECS/index.js +0 -21
  311. package/bin/ECS/index.js.map +0 -1
  312. package/bin/Platform/IPlatformAdapter.d.ts +0 -169
  313. package/bin/Platform/IPlatformAdapter.d.ts.map +0 -1
  314. package/bin/Platform/IPlatformAdapter.js +0 -2
  315. package/bin/Platform/IPlatformAdapter.js.map +0 -1
  316. package/bin/Platform/PlatformDetector.d.ts +0 -56
  317. package/bin/Platform/PlatformDetector.d.ts.map +0 -1
  318. package/bin/Platform/PlatformDetector.js +0 -247
  319. package/bin/Platform/PlatformDetector.js.map +0 -1
  320. package/bin/Platform/PlatformManager.d.ts +0 -50
  321. package/bin/Platform/PlatformManager.d.ts.map +0 -1
  322. package/bin/Platform/PlatformManager.js +0 -114
  323. package/bin/Platform/PlatformManager.js.map +0 -1
  324. package/bin/Platform/index.d.ts +0 -19
  325. package/bin/Platform/index.d.ts.map +0 -1
  326. package/bin/Platform/index.js +0 -29
  327. package/bin/Platform/index.js.map +0 -1
  328. package/bin/Plugins/DebugPlugin.d.ts +0 -156
  329. package/bin/Plugins/DebugPlugin.d.ts.map +0 -1
  330. package/bin/Plugins/DebugPlugin.js +0 -248
  331. package/bin/Plugins/DebugPlugin.js.map +0 -1
  332. package/bin/Plugins/index.d.ts +0 -2
  333. package/bin/Plugins/index.d.ts.map +0 -1
  334. package/bin/Plugins/index.js +0 -2
  335. package/bin/Plugins/index.js.map +0 -1
  336. package/bin/Types/IUpdatable.d.ts +0 -18
  337. package/bin/Types/IUpdatable.d.ts.map +0 -1
  338. package/bin/Types/IUpdatable.js +0 -7
  339. package/bin/Types/IUpdatable.js.map +0 -1
  340. package/bin/Types/TypeHelpers.d.ts +0 -238
  341. package/bin/Types/TypeHelpers.d.ts.map +0 -1
  342. package/bin/Types/TypeHelpers.js +0 -19
  343. package/bin/Types/TypeHelpers.js.map +0 -1
  344. package/bin/Types/index.d.ts +0 -466
  345. package/bin/Types/index.d.ts.map +0 -1
  346. package/bin/Types/index.js +0 -7
  347. package/bin/Types/index.js.map +0 -1
  348. package/bin/Utils/BinarySerializer.d.ts +0 -23
  349. package/bin/Utils/BinarySerializer.d.ts.map +0 -1
  350. package/bin/Utils/BinarySerializer.js +0 -100
  351. package/bin/Utils/BinarySerializer.js.map +0 -1
  352. package/bin/Utils/Debug/AdvancedProfilerCollector.d.ts +0 -153
  353. package/bin/Utils/Debug/AdvancedProfilerCollector.d.ts.map +0 -1
  354. package/bin/Utils/Debug/AdvancedProfilerCollector.js +0 -406
  355. package/bin/Utils/Debug/AdvancedProfilerCollector.js.map +0 -1
  356. package/bin/Utils/Debug/ComponentDataCollector.d.ts +0 -32
  357. package/bin/Utils/Debug/ComponentDataCollector.d.ts.map +0 -1
  358. package/bin/Utils/Debug/ComponentDataCollector.js +0 -250
  359. package/bin/Utils/Debug/ComponentDataCollector.js.map +0 -1
  360. package/bin/Utils/Debug/DebugConfigService.d.ts +0 -16
  361. package/bin/Utils/Debug/DebugConfigService.d.ts.map +0 -1
  362. package/bin/Utils/Debug/DebugConfigService.js +0 -42
  363. package/bin/Utils/Debug/DebugConfigService.js.map +0 -1
  364. package/bin/Utils/Debug/DebugManager.d.ts +0 -131
  365. package/bin/Utils/Debug/DebugManager.d.ts.map +0 -1
  366. package/bin/Utils/Debug/DebugManager.js +0 -848
  367. package/bin/Utils/Debug/DebugManager.js.map +0 -1
  368. package/bin/Utils/Debug/EntityDataCollector.d.ts +0 -115
  369. package/bin/Utils/Debug/EntityDataCollector.d.ts.map +0 -1
  370. package/bin/Utils/Debug/EntityDataCollector.js +0 -870
  371. package/bin/Utils/Debug/EntityDataCollector.js.map +0 -1
  372. package/bin/Utils/Debug/PerformanceDataCollector.d.ts +0 -31
  373. package/bin/Utils/Debug/PerformanceDataCollector.d.ts.map +0 -1
  374. package/bin/Utils/Debug/PerformanceDataCollector.js +0 -203
  375. package/bin/Utils/Debug/PerformanceDataCollector.js.map +0 -1
  376. package/bin/Utils/Debug/SceneDataCollector.d.ts +0 -18
  377. package/bin/Utils/Debug/SceneDataCollector.d.ts.map +0 -1
  378. package/bin/Utils/Debug/SceneDataCollector.js +0 -43
  379. package/bin/Utils/Debug/SceneDataCollector.js.map +0 -1
  380. package/bin/Utils/Debug/SystemDataCollector.d.ts +0 -14
  381. package/bin/Utils/Debug/SystemDataCollector.d.ts.map +0 -1
  382. package/bin/Utils/Debug/SystemDataCollector.js +0 -60
  383. package/bin/Utils/Debug/SystemDataCollector.js.map +0 -1
  384. package/bin/Utils/Debug/WebSocketManager.d.ts +0 -54
  385. package/bin/Utils/Debug/WebSocketManager.d.ts.map +0 -1
  386. package/bin/Utils/Debug/WebSocketManager.js +0 -141
  387. package/bin/Utils/Debug/WebSocketManager.js.map +0 -1
  388. package/bin/Utils/Debug/index.d.ts +0 -11
  389. package/bin/Utils/Debug/index.d.ts.map +0 -1
  390. package/bin/Utils/Debug/index.js +0 -10
  391. package/bin/Utils/Debug/index.js.map +0 -1
  392. package/bin/Utils/Emitter.d.ts +0 -61
  393. package/bin/Utils/Emitter.d.ts.map +0 -1
  394. package/bin/Utils/Emitter.js +0 -101
  395. package/bin/Utils/Emitter.js.map +0 -1
  396. package/bin/Utils/Extensions/NumberExtension.d.ts +0 -13
  397. package/bin/Utils/Extensions/NumberExtension.d.ts.map +0 -1
  398. package/bin/Utils/Extensions/NumberExtension.js +0 -17
  399. package/bin/Utils/Extensions/NumberExtension.js.map +0 -1
  400. package/bin/Utils/Extensions/TypeUtils.d.ts +0 -13
  401. package/bin/Utils/Extensions/TypeUtils.d.ts.map +0 -1
  402. package/bin/Utils/Extensions/TypeUtils.js +0 -15
  403. package/bin/Utils/Extensions/TypeUtils.js.map +0 -1
  404. package/bin/Utils/Extensions/index.d.ts +0 -3
  405. package/bin/Utils/Extensions/index.d.ts.map +0 -1
  406. package/bin/Utils/Extensions/index.js +0 -4
  407. package/bin/Utils/Extensions/index.js.map +0 -1
  408. package/bin/Utils/GlobalManager.d.ts +0 -29
  409. package/bin/Utils/GlobalManager.d.ts.map +0 -1
  410. package/bin/Utils/GlobalManager.js +0 -50
  411. package/bin/Utils/GlobalManager.js.map +0 -1
  412. package/bin/Utils/Logger/ConsoleLogger.d.ts +0 -74
  413. package/bin/Utils/Logger/ConsoleLogger.d.ts.map +0 -1
  414. package/bin/Utils/Logger/ConsoleLogger.js +0 -187
  415. package/bin/Utils/Logger/ConsoleLogger.js.map +0 -1
  416. package/bin/Utils/Logger/Constants.d.ts +0 -36
  417. package/bin/Utils/Logger/Constants.d.ts.map +0 -1
  418. package/bin/Utils/Logger/Constants.js +0 -40
  419. package/bin/Utils/Logger/Constants.js.map +0 -1
  420. package/bin/Utils/Logger/LoggerManager.d.ts +0 -91
  421. package/bin/Utils/Logger/LoggerManager.d.ts.map +0 -1
  422. package/bin/Utils/Logger/LoggerManager.js +0 -167
  423. package/bin/Utils/Logger/LoggerManager.js.map +0 -1
  424. package/bin/Utils/Logger/Types.d.ts +0 -40
  425. package/bin/Utils/Logger/Types.d.ts.map +0 -1
  426. package/bin/Utils/Logger/Types.js +0 -2
  427. package/bin/Utils/Logger/Types.js.map +0 -1
  428. package/bin/Utils/Logger/index.d.ts +0 -5
  429. package/bin/Utils/Logger/index.d.ts.map +0 -1
  430. package/bin/Utils/Logger/index.js +0 -5
  431. package/bin/Utils/Logger/index.js.map +0 -1
  432. package/bin/Utils/PerformanceMonitor.d.ts +0 -196
  433. package/bin/Utils/PerformanceMonitor.d.ts.map +0 -1
  434. package/bin/Utils/PerformanceMonitor.js +0 -244
  435. package/bin/Utils/PerformanceMonitor.js.map +0 -1
  436. package/bin/Utils/Pool/IPoolable.d.ts +0 -29
  437. package/bin/Utils/Pool/IPoolable.d.ts.map +0 -1
  438. package/bin/Utils/Pool/IPoolable.js +0 -2
  439. package/bin/Utils/Pool/IPoolable.js.map +0 -1
  440. package/bin/Utils/Pool/Pool.d.ts +0 -109
  441. package/bin/Utils/Pool/Pool.d.ts.map +0 -1
  442. package/bin/Utils/Pool/Pool.js +0 -238
  443. package/bin/Utils/Pool/Pool.js.map +0 -1
  444. package/bin/Utils/Pool/PoolManager.d.ts +0 -96
  445. package/bin/Utils/Pool/PoolManager.d.ts.map +0 -1
  446. package/bin/Utils/Pool/PoolManager.js +0 -199
  447. package/bin/Utils/Pool/PoolManager.js.map +0 -1
  448. package/bin/Utils/Pool/index.d.ts +0 -4
  449. package/bin/Utils/Pool/index.d.ts.map +0 -1
  450. package/bin/Utils/Pool/index.js +0 -4
  451. package/bin/Utils/Pool/index.js.map +0 -1
  452. package/bin/Utils/Profiler/AutoProfiler.d.ts +0 -160
  453. package/bin/Utils/Profiler/AutoProfiler.d.ts.map +0 -1
  454. package/bin/Utils/Profiler/AutoProfiler.js +0 -503
  455. package/bin/Utils/Profiler/AutoProfiler.js.map +0 -1
  456. package/bin/Utils/Profiler/ProfilerSDK.d.ts +0 -175
  457. package/bin/Utils/Profiler/ProfilerSDK.d.ts.map +0 -1
  458. package/bin/Utils/Profiler/ProfilerSDK.js +0 -727
  459. package/bin/Utils/Profiler/ProfilerSDK.js.map +0 -1
  460. package/bin/Utils/Profiler/ProfilerTypes.d.ts +0 -218
  461. package/bin/Utils/Profiler/ProfilerTypes.d.ts.map +0 -1
  462. package/bin/Utils/Profiler/ProfilerTypes.js +0 -47
  463. package/bin/Utils/Profiler/ProfilerTypes.js.map +0 -1
  464. package/bin/Utils/Profiler/index.d.ts +0 -8
  465. package/bin/Utils/Profiler/index.d.ts.map +0 -1
  466. package/bin/Utils/Profiler/index.js +0 -7
  467. package/bin/Utils/Profiler/index.js.map +0 -1
  468. package/bin/Utils/Time.d.ts +0 -47
  469. package/bin/Utils/Time.d.ts.map +0 -1
  470. package/bin/Utils/Time.js +0 -64
  471. package/bin/Utils/Time.js.map +0 -1
  472. package/bin/Utils/Timers/ITimer.d.ts +0 -16
  473. package/bin/Utils/Timers/ITimer.d.ts.map +0 -1
  474. package/bin/Utils/Timers/ITimer.js +0 -2
  475. package/bin/Utils/Timers/ITimer.js.map +0 -1
  476. package/bin/Utils/Timers/Timer.d.ts +0 -30
  477. package/bin/Utils/Timers/Timer.d.ts.map +0 -1
  478. package/bin/Utils/Timers/Timer.js +0 -58
  479. package/bin/Utils/Timers/Timer.js.map +0 -1
  480. package/bin/Utils/Timers/TimerManager.d.ts +0 -26
  481. package/bin/Utils/Timers/TimerManager.d.ts.map +0 -1
  482. package/bin/Utils/Timers/TimerManager.js +0 -48
  483. package/bin/Utils/Timers/TimerManager.js.map +0 -1
  484. package/bin/Utils/index.d.ts +0 -11
  485. package/bin/Utils/index.d.ts.map +0 -1
  486. package/bin/Utils/index.js +0 -11
  487. package/bin/Utils/index.js.map +0 -1
  488. package/bin/index.d.ts +0 -29
  489. package/bin/index.d.ts.map +0 -1
  490. package/bin/index.js +0 -36
  491. package/bin/index.js.map +0 -1
@@ -1,799 +0,0 @@
1
- import { Entity } from './Entity';
2
- import { EntityList } from './Utils/EntityList';
3
- import { IdentifierPool } from './Utils/IdentifierPool';
4
- import { EntitySystem } from './Systems/EntitySystem';
5
- import { ComponentStorageManager, ComponentType } from './Core/ComponentStorage';
6
- import { QuerySystem } from './Core/QuerySystem';
7
- import { TypeSafeEventSystem } from './Core/EventSystem';
8
- import { ReferenceTracker } from './Core/ReferenceTracker';
9
- import { IScene, ISceneConfig } from './IScene';
10
- import { TypedQueryBuilder } from './Core/Query/TypedQuery';
11
- import { SceneSerializationOptions, SceneDeserializationOptions } from './Serialization/SceneSerializer';
12
- import { IncrementalSnapshot, IncrementalSerializationOptions } from './Serialization/IncrementalSerializer';
13
- import { PerformanceMonitor } from '../Utils/PerformanceMonitor';
14
- import { ServiceContainer, type ServiceType } from '../Core/ServiceContainer';
15
- /**
16
- * 游戏场景默认实现类
17
- *
18
- * 实现IScene接口,提供场景的基础功能。
19
- * 推荐使用组合而非继承的方式来构建自定义场景。
20
- */
21
- export declare class Scene implements IScene {
22
- /**
23
- * 场景名称
24
- *
25
- * 用于标识和调试的友好名称。
26
- */
27
- name: string;
28
- /**
29
- * 场景自定义数据
30
- *
31
- * 用于存储场景级别的配置和状态数据。
32
- */
33
- readonly sceneData: Map<string, any>;
34
- /**
35
- * 场景中的实体集合
36
- *
37
- * 管理场景内所有实体的生命周期。
38
- */
39
- readonly entities: EntityList;
40
- /**
41
- * 实体ID池
42
- *
43
- * 用于分配和回收实体的唯一标识符。
44
- */
45
- readonly identifierPool: IdentifierPool;
46
- /**
47
- * 组件存储管理器
48
- *
49
- * 高性能的组件存储和查询系统。
50
- */
51
- readonly componentStorageManager: ComponentStorageManager;
52
- /**
53
- * 查询系统
54
- *
55
- * 基于位掩码的高性能实体查询系统。
56
- */
57
- readonly querySystem: QuerySystem;
58
- /**
59
- * 事件系统
60
- *
61
- * 类型安全的事件系统。
62
- */
63
- readonly eventSystem: TypeSafeEventSystem;
64
- /**
65
- * 引用追踪器
66
- *
67
- * 追踪Component中对Entity的引用,当Entity销毁时自动清理引用。
68
- */
69
- readonly referenceTracker: ReferenceTracker;
70
- /**
71
- * 服务容器
72
- *
73
- * 场景级别的依赖注入容器,用于管理EntitySystem和其他服务的生命周期。
74
- * 每个Scene拥有独立的服务容器,实现场景间的隔离。
75
- */
76
- private readonly _services;
77
- /**
78
- * 日志记录器
79
- */
80
- private readonly logger;
81
- /**
82
- * 性能监控器缓存
83
- *
84
- * 用于监控场景和系统的性能。从 ServiceContainer 获取。
85
- */
86
- private _performanceMonitor;
87
- /**
88
- * 场景是否已开始运行
89
- */
90
- private _didSceneBegin;
91
- /**
92
- * 编辑器模式标志
93
- *
94
- * 当为 true 时,组件的生命周期回调(如 onAddedToEntity)会被延迟,
95
- * 直到调用 begin() 开始运行场景时才会触发。
96
- *
97
- * Editor mode flag.
98
- * When true, component lifecycle callbacks (like onAddedToEntity) are deferred
99
- * until begin() is called to start running the scene.
100
- */
101
- isEditorMode: boolean;
102
- /**
103
- * 延迟的组件生命周期回调队列
104
- *
105
- * 在编辑器模式下,组件的 onAddedToEntity 回调会被加入此队列,
106
- * 等到 begin() 调用时统一执行。
107
- *
108
- * Deferred component lifecycle callback queue.
109
- * In editor mode, component's onAddedToEntity callbacks are queued here,
110
- * and will be executed when begin() is called.
111
- */
112
- private _deferredComponentCallbacks;
113
- /**
114
- * 系统列表缓存
115
- */
116
- private _cachedSystems;
117
- /**
118
- * 系统顺序脏标记
119
- *
120
- * 当系统增删或 updateOrder 改变时标记为 true,下次访问 systems 时重新构建缓存
121
- */
122
- private _systemsOrderDirty;
123
- /**
124
- * 系统错误计数器
125
- *
126
- * 跟踪每个系统的错误次数,用于自动禁用频繁出错的系统
127
- */
128
- private _systemErrorCount;
129
- /**
130
- * 最大允许错误次数
131
- *
132
- * 系统错误次数超过此阈值后将被自动禁用
133
- */
134
- private _maxErrorCount;
135
- /**
136
- * 系统添加计数器
137
- *
138
- * 用于为每个添加的系统分配唯一的添加顺序,保证排序稳定性
139
- * Counter for assigning unique add order to each system for stable sorting
140
- */
141
- private _systemAddCounter;
142
- /**
143
- * 组件ID到系统的索引映射
144
- *
145
- * 用于快速查找关心特定组件的系统,避免遍历所有系统。
146
- * 使用组件ID(数字)而非ComponentType作为key,避免类引用问题。
147
- *
148
- * Component ID to systems index map.
149
- * Used for fast lookup of systems that care about specific components.
150
- * Uses component ID (number) instead of ComponentType as key to avoid class reference issues.
151
- */
152
- private _componentIdToSystems;
153
- /**
154
- * 需要接收所有组件变化通知的系统集合
155
- *
156
- * 包括使用 none 条件、tag/name 查询、或空匹配器的系统。
157
- * 这些系统无法通过组件ID索引优化,需要在每次组件变化时都检查。
158
- *
159
- * Systems that need to receive all component change notifications.
160
- * Includes systems using none conditions, tag/name queries, or empty matchers.
161
- * These systems cannot be optimized via component ID indexing.
162
- */
163
- private _globalNotifySystems;
164
- /**
165
- * 获取场景中所有已注册的EntitySystem
166
- *
167
- * 按updateOrder排序。使用缓存机制,仅在系统变化时重新排序。
168
- *
169
- * @returns 系统列表
170
- */
171
- get systems(): EntitySystem[];
172
- /**
173
- * 重新构建系统缓存
174
- *
175
- * 从服务容器中提取所有EntitySystem并排序
176
- */
177
- private _rebuildSystemsCache;
178
- /**
179
- * 从服务列表中过滤出EntitySystem实例
180
- */
181
- private _filterEntitySystems;
182
- /**
183
- * 按 updateOrder 排序系统,相同时按 addOrder 保证稳定性
184
- * Sort systems by updateOrder, use addOrder as secondary key for stability
185
- */
186
- private _sortSystemsByUpdateOrder;
187
- /**
188
- * 通过类型获取System实例
189
- *
190
- * @param systemType System类型
191
- * @returns System实例,如果未找到则返回null
192
- *
193
- * @example
194
- * ```typescript
195
- * const physics = scene.getSystem(PhysicsSystem);
196
- * if (physics) {
197
- * physics.doSomething();
198
- * }
199
- * ```
200
- */
201
- getSystem<T extends EntitySystem>(systemType: ServiceType<T>): T | null;
202
- /**
203
- * 标记系统顺序为脏
204
- *
205
- * 当系统列表或顺序发生变化时调用,使缓存失效
206
- */
207
- markSystemsOrderDirty(): void;
208
- /**
209
- * 获取场景的服务容器
210
- *
211
- * 用于注册和解析场景级别的服务(如EntitySystem)。
212
- *
213
- * @example
214
- * ```typescript
215
- * // 注册服务
216
- * scene.services.registerSingleton(PhysicsSystem);
217
- *
218
- * // 解析服务
219
- * const physics = scene.services.resolve(PhysicsSystem);
220
- * ```
221
- */
222
- get services(): ServiceContainer;
223
- /**
224
- * 创建场景实例
225
- */
226
- constructor(config?: ISceneConfig);
227
- /**
228
- * 获取性能监控器
229
- *
230
- * 从 ServiceContainer 获取,如果未注册则创建默认实例(向后兼容)
231
- */
232
- get performanceMonitor(): PerformanceMonitor;
233
- /**
234
- * 初始化场景
235
- *
236
- * 在场景创建时调用,子类可以重写此方法来设置初始实体和组件。
237
- */
238
- initialize(): void;
239
- /**
240
- * 场景开始运行时的回调
241
- *
242
- * 在场景开始运行时调用,可以在此方法中执行场景启动逻辑。
243
- */
244
- onStart(): void;
245
- /**
246
- * 场景卸载时的回调
247
- *
248
- * 在场景被销毁时调用,可以在此方法中执行清理工作。
249
- */
250
- unload(): void;
251
- /**
252
- * 添加延迟的组件生命周期回调
253
- *
254
- * 在编辑器模式下,组件的 onAddedToEntity 回调会通过此方法加入队列。
255
- *
256
- * Queue a deferred component lifecycle callback.
257
- * In editor mode, component's onAddedToEntity callbacks are queued via this method.
258
- *
259
- * @param callback 要延迟执行的回调 | The callback to defer
260
- */
261
- queueDeferredComponentCallback(callback: () => void): void;
262
- /**
263
- * 开始场景,启动实体处理器等
264
- *
265
- * 这个方法会启动场景。它将启动实体处理器等,并调用onStart方法。
266
- * 在编辑器模式下,此方法还会执行所有延迟的组件生命周期回调。
267
- *
268
- * This method starts the scene. It will start entity processors and call onStart.
269
- * In editor mode, this method also executes all deferred component lifecycle callbacks.
270
- */
271
- begin(): void;
272
- /**
273
- * 结束场景,清除实体、实体处理器等
274
- *
275
- * 这个方法会结束场景。它将移除所有实体,结束实体处理器等,并调用unload方法。
276
- *
277
- * 执行顺序:
278
- * 1. 调用 unload() - 用户可以在此访问实体和系统进行清理
279
- * 2. 清理所有实体
280
- * 3. 清空服务容器,触发所有系统的 onDestroy()
281
- *
282
- * 注意:
283
- * - onRemoved 回调不会在 Scene.end() 时触发,因为这是批量销毁场景
284
- * - 用户清理:在 Scene.unload() 中处理(可访问实体和系统)
285
- * - 系统清理:在 System.onDestroy() 中处理(实体已被清理)
286
- */
287
- end(): void;
288
- /**
289
- * 更新场景
290
- */
291
- update(): void;
292
- /**
293
- * 执行所有系统的延迟命令
294
- * Flush all systems' deferred commands
295
- *
296
- * 在帧末统一执行所有通过 CommandBuffer 提交的延迟操作。
297
- * Execute all deferred operations submitted via CommandBuffer at end of frame.
298
- */
299
- private flushCommandBuffers;
300
- /**
301
- * 处理系统执行错误
302
- *
303
- * 记录错误信息并跟踪错误次数。当系统错误次数超过阈值时自动禁用该系统。
304
- *
305
- * @param system 出错的系统
306
- * @param phase 错误发生的阶段(update 或 lateUpdate)
307
- * @param error 错误对象
308
- */
309
- private _handleSystemError;
310
- /**
311
- * 将实体添加到此场景,并返回它
312
- * @param name 实体名称
313
- */
314
- createEntity(name: string): Entity;
315
- /**
316
- * 清除所有EntitySystem的实体缓存
317
- * 当实体或组件发生变化时调用
318
- */
319
- clearSystemEntityCaches(): void;
320
- /**
321
- * 通知相关系统实体的组件发生了变化
322
- *
323
- * 这是事件驱动设计的核心:当组件被添加或移除时,立即通知相关系统检查该实体是否匹配,
324
- * 并触发 onAdded/onRemoved 回调。通过组件ID索引优化,只通知关心该组件的系统。
325
- *
326
- * This is the core of event-driven design: when a component is added or removed,
327
- * immediately notify relevant systems to check if the entity matches and trigger
328
- * onAdded/onRemoved callbacks. Optimized via component ID indexing to only notify
329
- * systems that care about the changed component.
330
- *
331
- * @param entity 组件发生变化的实体 | The entity whose components changed
332
- * @param changedComponentType 变化的组件类型(可选) | The changed component type (optional)
333
- */
334
- notifyEntityComponentChanged(entity: Entity, changedComponentType?: ComponentType): void;
335
- /**
336
- * 将系统添加到组件索引
337
- *
338
- * 根据系统的 Matcher 条件,将系统注册到相应的组件ID索引中。
339
- *
340
- * Index a system by its interested component types.
341
- * Registers the system to component ID indices based on its Matcher conditions.
342
- *
343
- * @param system 要索引的系统 | The system to index
344
- */
345
- private indexSystemByComponents;
346
- /**
347
- * 将系统添加到指定组件的索引
348
- *
349
- * Add system to the index for a specific component type.
350
- *
351
- * @param componentType 组件类型 | Component type
352
- * @param system 系统 | System
353
- */
354
- private addSystemToComponentIndex;
355
- /**
356
- * 从组件索引中移除系统
357
- *
358
- * Remove a system from all component indices.
359
- *
360
- * @param system 要移除的系统 | The system to remove
361
- */
362
- private removeSystemFromIndex;
363
- /**
364
- * 在场景的实体列表中添加一个实体
365
- * @param entity 要添加的实体
366
- * @param deferCacheClear 是否延迟缓存清理(用于批量操作)
367
- */
368
- addEntity(entity: Entity, deferCacheClear?: boolean): Entity;
369
- /**
370
- * 批量创建实体(高性能版本)
371
- * @param count 要创建的实体数量
372
- * @param namePrefix 实体名称前缀
373
- * @returns 创建的实体列表
374
- */
375
- createEntities(count: number, namePrefix?: string): Entity[];
376
- /**
377
- * 批量销毁实体
378
- */
379
- destroyEntities(entities: Entity[]): void;
380
- /**
381
- * 从场景中删除所有实体
382
- */
383
- destroyAllEntities(): void;
384
- /**
385
- * 搜索并返回第一个具有名称的实体
386
- * @param name 实体名称
387
- */
388
- findEntity(name: string): Entity | null;
389
- /**
390
- * 根据ID查找实体
391
- * @param id 实体ID
392
- */
393
- findEntityById(id: number): Entity | null;
394
- /**
395
- * 根据标签查找实体
396
- * @param tag 实体标签
397
- */
398
- findEntitiesByTag(tag: number): Entity[];
399
- /**
400
- * 查找所有持久化实体
401
- *
402
- * Find all persistent entities in this scene.
403
- *
404
- * @returns 持久化实体数组 | Array of persistent entities
405
- */
406
- findPersistentEntities(): Entity[];
407
- /**
408
- * 提取持久化实体(从场景中分离但不销毁)
409
- *
410
- * 用于场景切换时收集需要迁移的实体。
411
- *
412
- * Extract persistent entities (detach from scene without destroying).
413
- * Used during scene transitions to collect entities for migration.
414
- *
415
- * @returns 被提取的持久化实体数组 | Array of extracted persistent entities
416
- *
417
- * @internal
418
- */
419
- extractPersistentEntities(): Entity[];
420
- /**
421
- * 接收迁移的实体
422
- *
423
- * 将从其他场景迁移来的实体添加到当前场景。
424
- *
425
- * Receive migrated entities from another scene.
426
- *
427
- * @param entities 要接收的实体数组 | Entities to receive
428
- *
429
- * @internal
430
- */
431
- receiveMigratedEntities(entities: Entity[]): void;
432
- /**
433
- * 根据名称查找实体(别名方法)
434
- *
435
- * @param name 实体名称
436
- * @deprecated 请使用 findEntity() 代替此方法
437
- */
438
- getEntityByName(name: string): Entity | null;
439
- /**
440
- * 根据标签查找实体(别名方法)
441
- *
442
- * @param tag 实体标签
443
- * @deprecated 请使用 findEntitiesByTag() 代替此方法
444
- */
445
- getEntitiesByTag(tag: number): Entity[];
446
- /**
447
- * 查询拥有所有指定组件的实体
448
- *
449
- * @param componentTypes - 组件类型数组
450
- * @returns 查询结果
451
- *
452
- * @example
453
- * ```typescript
454
- * const result = scene.queryAll(Position, Velocity);
455
- * for (const entity of result.entities) {
456
- * const pos = entity.getComponent(Position);
457
- * const vel = entity.getComponent(Velocity);
458
- * }
459
- * ```
460
- */
461
- queryAll(...componentTypes: ComponentType[]): {
462
- entities: readonly Entity[];
463
- };
464
- /**
465
- * 查询拥有任意一个指定组件的实体
466
- *
467
- * @param componentTypes - 组件类型数组
468
- * @returns 查询结果
469
- */
470
- queryAny(...componentTypes: ComponentType[]): {
471
- entities: readonly Entity[];
472
- };
473
- /**
474
- * 查询不包含指定组件的实体
475
- *
476
- * @param componentTypes - 组件类型数组
477
- * @returns 查询结果
478
- */
479
- queryNone(...componentTypes: ComponentType[]): {
480
- entities: readonly Entity[];
481
- };
482
- /**
483
- * 创建类型安全的查询构建器
484
- *
485
- * @returns 查询构建器,支持链式调用
486
- *
487
- * @example
488
- * ```typescript
489
- * // 使用查询构建器
490
- * const matcher = scene.query()
491
- * .withAll(Position, Velocity)
492
- * .withNone(Disabled)
493
- * .buildMatcher();
494
- *
495
- * // 在System中使用
496
- * class MovementSystem extends EntitySystem {
497
- * constructor() {
498
- * super(matcher);
499
- * }
500
- * }
501
- * ```
502
- */
503
- query(): TypedQueryBuilder;
504
- /**
505
- * 在场景中添加一个EntitySystem处理器
506
- *
507
- * 支持两种使用方式:
508
- * 1. 传入类型(推荐):自动使用DI创建实例,支持@Injectable和@InjectProperty装饰器
509
- * 2. 传入实例:直接使用提供的实例
510
- *
511
- * @param systemTypeOrInstance 系统类型或系统实例
512
- * @returns 添加的处理器实例
513
- *
514
- * @example
515
- * ```typescript
516
- * // 方式1:传入类型,自动DI(推荐)
517
- * @Injectable()
518
- * class PhysicsSystem extends EntitySystem {
519
- * @InjectProperty(CollisionSystem)
520
- * private collision!: CollisionSystem;
521
- *
522
- * constructor() {
523
- * super(Matcher.empty().all(Transform));
524
- * }
525
- * }
526
- * scene.addEntityProcessor(PhysicsSystem);
527
- *
528
- * // 方式2:传入实例
529
- * const system = new MySystem();
530
- * scene.addEntityProcessor(system);
531
- * ```
532
- */
533
- addEntityProcessor<T extends EntitySystem>(systemTypeOrInstance: ServiceType<T> | T): T;
534
- /**
535
- * 批量注册EntitySystem到场景(使用DI)
536
- *
537
- * 自动按照依赖顺序注册多个System。
538
- * 所有System必须使用@Injectable装饰器标记。
539
- *
540
- * @param systemTypes System类型数组
541
- * @returns 注册的System实例数组
542
- *
543
- * @example
544
- * ```typescript
545
- * @Injectable()
546
- * @ECSSystem('Collision', { updateOrder: 5 })
547
- * class CollisionSystem extends EntitySystem implements IService {
548
- * constructor() { super(Matcher.empty().all(Collider)); }
549
- * dispose() {}
550
- * }
551
- *
552
- * @Injectable()
553
- * @ECSSystem('Physics', { updateOrder: 10 })
554
- * class PhysicsSystem extends EntitySystem implements IService {
555
- * @InjectProperty(CollisionSystem)
556
- * private collision!: CollisionSystem;
557
- *
558
- * constructor() {
559
- * super(Matcher.empty().all(Transform, RigidBody));
560
- * }
561
- * dispose() {}
562
- * }
563
- *
564
- * // 批量注册(自动解析依赖顺序)
565
- * scene.registerSystems([
566
- * CollisionSystem,
567
- * PhysicsSystem, // 自动注入CollisionSystem
568
- * RenderSystem
569
- * ]);
570
- * ```
571
- */
572
- registerSystems(systemTypes: Array<ServiceType<EntitySystem>>): EntitySystem[];
573
- /**
574
- * 添加系统到场景(addEntityProcessor的别名)
575
- * @param system 系统
576
- */
577
- addSystem(system: EntitySystem): EntitySystem;
578
- /**
579
- * 从场景中删除EntitySystem处理器
580
- * @param processor 要删除的处理器
581
- */
582
- removeEntityProcessor(processor: EntitySystem): void;
583
- /**
584
- * 从场景中删除系统(removeEntityProcessor的别名)
585
- * @param system 系统
586
- */
587
- removeSystem(system: EntitySystem): void;
588
- /**
589
- * 获取指定类型的EntitySystem处理器
590
- *
591
- * @deprecated 推荐使用依赖注入代替此方法。使用 `scene.services.resolve(SystemType)` 或使用 `@InjectProperty(SystemType)` 装饰器。
592
- *
593
- * @param type 处理器类型
594
- * @returns 处理器实例,如果未找到则返回null
595
- *
596
- * @example
597
- * ```typescript
598
- * @Injectable()
599
- * class MySystem extends EntitySystem {
600
- * @InjectProperty(PhysicsSystem)
601
- * private physics!: PhysicsSystem;
602
- *
603
- * constructor() {
604
- * super(Matcher.empty());
605
- * }
606
- * }
607
- * ```
608
- */
609
- getEntityProcessor<T extends EntitySystem>(type: new (...args: unknown[]) => T): T | null;
610
- /**
611
- * 获取场景统计信息
612
- */
613
- getStats(): {
614
- entityCount: number;
615
- processorCount: number;
616
- componentStorageStats: Map<string, {
617
- totalSlots: number;
618
- usedSlots: number;
619
- freeSlots: number;
620
- fragmentation: number;
621
- }>;
622
- };
623
- /**
624
- * 获取场景的调试信息
625
- */
626
- getDebugInfo(): {
627
- name: string;
628
- entityCount: number;
629
- processorCount: number;
630
- isRunning: boolean;
631
- entities: Array<{
632
- name: string;
633
- id: number;
634
- componentCount: number;
635
- componentTypes: string[];
636
- }>;
637
- processors: Array<{
638
- name: string;
639
- updateOrder: number;
640
- entityCount: number;
641
- }>;
642
- componentStats: Map<string, {
643
- totalSlots: number;
644
- usedSlots: number;
645
- freeSlots: number;
646
- fragmentation: number;
647
- }>;
648
- };
649
- /**
650
- * 序列化场景
651
- *
652
- * 将场景及其所有实体、组件序列化为JSON字符串或二进制Uint8Array
653
- *
654
- * @param options 序列化选项
655
- * @returns 序列化后的数据(JSON字符串或二进制Uint8Array)
656
- *
657
- * @example
658
- * ```typescript
659
- * // JSON格式
660
- * const jsonData = scene.serialize({
661
- * format: 'json',
662
- * pretty: true
663
- * });
664
- *
665
- * // 二进制格式(更小、更快)
666
- * const binaryData = scene.serialize({
667
- * format: 'binary'
668
- * });
669
- * ```
670
- */
671
- serialize(options?: SceneSerializationOptions): string | Uint8Array;
672
- /**
673
- * 反序列化场景
674
- *
675
- * 从序列化数据恢复场景状态
676
- *
677
- * @param saveData 序列化的数据(JSON字符串或二进制Uint8Array)
678
- * @param options 反序列化选项
679
- *
680
- * @example
681
- * ```typescript
682
- * // 从JSON恢复(自动从ComponentRegistry获取组件类型)
683
- * scene.deserialize(jsonData, {
684
- * strategy: 'replace'
685
- * });
686
- *
687
- * // 从二进制恢复
688
- * scene.deserialize(binaryData, {
689
- * strategy: 'replace'
690
- * });
691
- * ```
692
- */
693
- deserialize(saveData: string | Uint8Array, options?: SceneDeserializationOptions): void;
694
- /** 增量序列化的基础快照 */
695
- private _incrementalBaseSnapshot?;
696
- /**
697
- * 创建增量序列化的基础快照
698
- *
699
- * 在需要进行增量序列化前,先调用此方法创建基础快照
700
- *
701
- * @param options 序列化选项
702
- *
703
- * @example
704
- * ```typescript
705
- * // 创建基础快照
706
- * scene.createIncrementalSnapshot();
707
- *
708
- * // 进行一些修改...
709
- * entity.addComponent(new PositionComponent(100, 200));
710
- *
711
- * // 计算增量变更
712
- * const incremental = scene.serializeIncremental();
713
- * ```
714
- */
715
- createIncrementalSnapshot(options?: IncrementalSerializationOptions): void;
716
- /**
717
- * 增量序列化场景
718
- *
719
- * 只序列化相对于基础快照的变更部分
720
- *
721
- * @param options 序列化选项
722
- * @returns 增量快照对象
723
- *
724
- * @example
725
- * ```typescript
726
- * // 创建基础快照
727
- * scene.createIncrementalSnapshot();
728
- *
729
- * // 修改场景
730
- * const entity = scene.createEntity('NewEntity');
731
- * entity.addComponent(new PositionComponent(50, 100));
732
- *
733
- * // 获取增量变更
734
- * const incremental = scene.serializeIncremental();
735
- * console.log(`变更数量: ${incremental.entityChanges.length}`);
736
- *
737
- * // 序列化为JSON
738
- * const json = IncrementalSerializer.serializeIncremental(incremental);
739
- * ```
740
- */
741
- serializeIncremental(options?: IncrementalSerializationOptions): IncrementalSnapshot;
742
- /**
743
- * 应用增量变更到场景
744
- *
745
- * @param incremental 增量快照数据(IncrementalSnapshot对象、JSON字符串或二进制Uint8Array)
746
- * @param componentRegistry 组件类型注册表(可选,默认使用全局注册表)
747
- *
748
- * @example
749
- * ```typescript
750
- * // 应用增量变更对象
751
- * scene.applyIncremental(incrementalSnapshot);
752
- *
753
- * // 从JSON字符串应用
754
- * const jsonData = IncrementalSerializer.serializeIncremental(snapshot, { format: 'json' });
755
- * scene.applyIncremental(jsonData);
756
- *
757
- * // 从二进制Uint8Array应用
758
- * const binaryData = IncrementalSerializer.serializeIncremental(snapshot, { format: 'binary' });
759
- * scene.applyIncremental(binaryData);
760
- * ```
761
- */
762
- applyIncremental(incremental: IncrementalSnapshot | string | Uint8Array, componentRegistry?: Map<string, ComponentType>): void;
763
- /**
764
- * 更新增量快照基准
765
- *
766
- * 将当前场景状态设为新的增量序列化基准
767
- *
768
- * @param options 序列化选项
769
- *
770
- * @example
771
- * ```typescript
772
- * // 创建初始快照
773
- * scene.createIncrementalSnapshot();
774
- *
775
- * // 进行一些修改并序列化
776
- * const incremental1 = scene.serializeIncremental();
777
- *
778
- * // 更新基准,之后的增量将基于当前状态
779
- * scene.updateIncrementalSnapshot();
780
- *
781
- * // 继续修改
782
- * const incremental2 = scene.serializeIncremental();
783
- * ```
784
- */
785
- updateIncrementalSnapshot(options?: IncrementalSerializationOptions): void;
786
- /**
787
- * 清除增量快照
788
- *
789
- * 释放快照占用的内存
790
- */
791
- clearIncrementalSnapshot(): void;
792
- /**
793
- * 检查是否有增量快照
794
- *
795
- * @returns 如果已创建增量快照返回true
796
- */
797
- hasIncrementalSnapshot(): boolean;
798
- }
799
- //# sourceMappingURL=Scene.d.ts.map