@esengine/ecs-framework 2.0.6 → 2.0.8

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 (124) hide show
  1. package/bin/Core.js +21 -17
  2. package/bin/Core.js.map +1 -1
  3. package/bin/ECS/Component.js +5 -1
  4. package/bin/ECS/Component.js.map +1 -1
  5. package/bin/ECS/Components/IUpdatable.js +7 -2
  6. package/bin/ECS/Components/IUpdatable.js.map +1 -1
  7. package/bin/ECS/Components/SceneComponent.js +5 -1
  8. package/bin/ECS/Components/SceneComponent.js.map +1 -1
  9. package/bin/ECS/Core/BitMaskOptimizer.d.ts +75 -0
  10. package/bin/ECS/Core/BitMaskOptimizer.d.ts.map +1 -0
  11. package/bin/ECS/Core/BitMaskOptimizer.js +165 -0
  12. package/bin/ECS/Core/BitMaskOptimizer.js.map +1 -0
  13. package/bin/ECS/Core/ComponentPool.d.ts +72 -0
  14. package/bin/ECS/Core/ComponentPool.d.ts.map +1 -0
  15. package/bin/ECS/Core/ComponentPool.js +128 -0
  16. package/bin/ECS/Core/ComponentPool.js.map +1 -0
  17. package/bin/ECS/Core/ComponentStorage.js +9 -3
  18. package/bin/ECS/Core/ComponentStorage.js.map +1 -1
  19. package/bin/ECS/Core/EventSystem.js +12 -6
  20. package/bin/ECS/Core/EventSystem.js.map +1 -1
  21. package/bin/ECS/Core/FluentAPI.js +24 -17
  22. package/bin/ECS/Core/FluentAPI.js.map +1 -1
  23. package/bin/ECS/Core/IndexUpdateBatcher.d.ts +100 -0
  24. package/bin/ECS/Core/IndexUpdateBatcher.d.ts.map +1 -0
  25. package/bin/ECS/Core/IndexUpdateBatcher.js +223 -0
  26. package/bin/ECS/Core/IndexUpdateBatcher.js.map +1 -0
  27. package/bin/ECS/Core/QuerySystem.d.ts +292 -444
  28. package/bin/ECS/Core/QuerySystem.d.ts.map +1 -1
  29. package/bin/ECS/Core/QuerySystem.js +661 -1075
  30. package/bin/ECS/Core/QuerySystem.js.map +1 -1
  31. package/bin/ECS/CoreEvents.js +5 -2
  32. package/bin/ECS/CoreEvents.js.map +1 -1
  33. package/bin/ECS/Entity.js +17 -12
  34. package/bin/ECS/Entity.js.map +1 -1
  35. package/bin/ECS/Scene.d.ts +18 -2
  36. package/bin/ECS/Scene.d.ts.map +1 -1
  37. package/bin/ECS/Scene.js +67 -19
  38. package/bin/ECS/Scene.js.map +1 -1
  39. package/bin/ECS/Systems/EntitySystem.js +9 -5
  40. package/bin/ECS/Systems/EntitySystem.js.map +1 -1
  41. package/bin/ECS/Systems/IntervalSystem.js +8 -4
  42. package/bin/ECS/Systems/IntervalSystem.js.map +1 -1
  43. package/bin/ECS/Systems/PassiveSystem.js +6 -2
  44. package/bin/ECS/Systems/PassiveSystem.js.map +1 -1
  45. package/bin/ECS/Systems/ProcessingSystem.js +6 -2
  46. package/bin/ECS/Systems/ProcessingSystem.js.map +1 -1
  47. package/bin/ECS/Systems/index.js +11 -4
  48. package/bin/ECS/Systems/index.js.map +1 -1
  49. package/bin/ECS/Utils/Bits.js +5 -1
  50. package/bin/ECS/Utils/Bits.js.map +1 -1
  51. package/bin/ECS/Utils/ComponentTypeManager.js +8 -4
  52. package/bin/ECS/Utils/ComponentTypeManager.js.map +1 -1
  53. package/bin/ECS/Utils/EntityList.js +5 -1
  54. package/bin/ECS/Utils/EntityList.js.map +1 -1
  55. package/bin/ECS/Utils/EntityProcessorList.js +5 -1
  56. package/bin/ECS/Utils/EntityProcessorList.js.map +1 -1
  57. package/bin/ECS/Utils/IdentifierPool.js +5 -1
  58. package/bin/ECS/Utils/IdentifierPool.js.map +1 -1
  59. package/bin/ECS/Utils/Matcher.js +8 -4
  60. package/bin/ECS/Utils/Matcher.js.map +1 -1
  61. package/bin/ECS/Utils/index.js +15 -6
  62. package/bin/ECS/Utils/index.js.map +1 -1
  63. package/bin/ECS/index.js +27 -6
  64. package/bin/ECS/index.js.map +1 -1
  65. package/bin/Testing/Performance/benchmark.d.ts +6 -0
  66. package/bin/Testing/Performance/benchmark.d.ts.map +1 -0
  67. package/bin/Testing/Performance/benchmark.js +639 -0
  68. package/bin/Testing/Performance/benchmark.js.map +1 -0
  69. package/bin/Testing/Unit/bitmask-optimizer.test.d.ts +2 -0
  70. package/bin/Testing/Unit/bitmask-optimizer.test.d.ts.map +1 -0
  71. package/bin/Testing/Unit/bitmask-optimizer.test.js +164 -0
  72. package/bin/Testing/Unit/bitmask-optimizer.test.js.map +1 -0
  73. package/bin/Testing/Unit/component-pool.test.d.ts +5 -0
  74. package/bin/Testing/Unit/component-pool.test.d.ts.map +1 -0
  75. package/bin/Testing/Unit/component-pool.test.js +149 -0
  76. package/bin/Testing/Unit/component-pool.test.js.map +1 -0
  77. package/bin/Testing/test-runner.d.ts +51 -0
  78. package/bin/Testing/test-runner.d.ts.map +1 -0
  79. package/bin/Testing/test-runner.js +159 -0
  80. package/bin/Testing/test-runner.js.map +1 -0
  81. package/bin/Types/index.js +7 -4
  82. package/bin/Types/index.js.map +1 -1
  83. package/bin/Utils/Emitter.js +7 -2
  84. package/bin/Utils/Emitter.js.map +1 -1
  85. package/bin/Utils/Extensions/NumberExtension.js +5 -1
  86. package/bin/Utils/Extensions/NumberExtension.js.map +1 -1
  87. package/bin/Utils/Extensions/TypeUtils.js +5 -1
  88. package/bin/Utils/Extensions/TypeUtils.js.map +1 -1
  89. package/bin/Utils/Extensions/index.js +7 -2
  90. package/bin/Utils/Extensions/index.js.map +1 -1
  91. package/bin/Utils/GlobalManager.js +5 -1
  92. package/bin/Utils/GlobalManager.js.map +1 -1
  93. package/bin/Utils/PerformanceMonitor.js +7 -3
  94. package/bin/Utils/PerformanceMonitor.js.map +1 -1
  95. package/bin/Utils/Pool.js +9 -3
  96. package/bin/Utils/Pool.js.map +1 -1
  97. package/bin/Utils/Time.js +5 -1
  98. package/bin/Utils/Time.js.map +1 -1
  99. package/bin/Utils/Timers/ITimer.js +2 -1
  100. package/bin/Utils/Timers/Timer.js +7 -3
  101. package/bin/Utils/Timers/Timer.js.map +1 -1
  102. package/bin/Utils/Timers/TimerManager.js +8 -4
  103. package/bin/Utils/Timers/TimerManager.js.map +1 -1
  104. package/bin/Utils/WasmCore.d.ts +234 -0
  105. package/bin/Utils/WasmCore.d.ts.map +1 -0
  106. package/bin/Utils/WasmCore.js +634 -0
  107. package/bin/Utils/WasmCore.js.map +1 -0
  108. package/bin/Utils/index.d.ts +10 -0
  109. package/bin/Utils/index.d.ts.map +1 -1
  110. package/bin/Utils/index.js +36 -5
  111. package/bin/Utils/index.js.map +1 -1
  112. package/bin/index.d.ts +1 -2
  113. package/bin/index.d.ts.map +1 -1
  114. package/bin/index.js +42 -14
  115. package/bin/index.js.map +1 -1
  116. package/package.json +58 -74
  117. package/bin/Utils/AccelerationProvider.d.ts +0 -192
  118. package/bin/Utils/AccelerationProvider.d.ts.map +0 -1
  119. package/bin/Utils/AccelerationProvider.js +0 -261
  120. package/bin/Utils/AccelerationProvider.js.map +0 -1
  121. package/bin/Utils/WasmBridge.d.ts +0 -152
  122. package/bin/Utils/WasmBridge.d.ts.map +0 -1
  123. package/bin/Utils/WasmBridge.js +0 -336
  124. package/bin/Utils/WasmBridge.js.map +0 -1
@@ -1,6 +1,37 @@
1
- // 工具类导出
2
- export * from './Extensions';
3
- export * from './Pool';
4
- export * from './PerformanceMonitor';
5
- export { Time } from './Time';
1
+ "use strict";
2
+ /**
3
+ * 工具模块导出
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.Query = exports.initializeEcs = exports.ecsCore = exports.WasmEcsCore = exports.Time = void 0;
21
+ __exportStar(require("./Extensions"), exports);
22
+ __exportStar(require("./Pool"), exports);
23
+ __exportStar(require("./Emitter"), exports);
24
+ __exportStar(require("./GlobalManager"), exports);
25
+ __exportStar(require("./PerformanceMonitor"), exports);
26
+ var Time_1 = require("./Time");
27
+ Object.defineProperty(exports, "Time", { enumerable: true, get: function () { return Time_1.Time; } });
28
+ /**
29
+ * WebAssembly核心模块
30
+ * 提供高性能的ECS查询和计算功能
31
+ */
32
+ var WasmCore_1 = require("./WasmCore");
33
+ Object.defineProperty(exports, "WasmEcsCore", { enumerable: true, get: function () { return WasmCore_1.WasmEcsCore; } });
34
+ Object.defineProperty(exports, "ecsCore", { enumerable: true, get: function () { return WasmCore_1.ecsCore; } });
35
+ Object.defineProperty(exports, "initializeEcs", { enumerable: true, get: function () { return WasmCore_1.initializeEcs; } });
36
+ Object.defineProperty(exports, "Query", { enumerable: true, get: function () { return WasmCore_1.Query; } });
6
37
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Utils/index.ts"],"names":[],"mappings":"AAAA,QAAQ;AACR,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/Utils/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;AAEH,+CAA6B;AAC7B,yCAAuB;AACvB,4CAA0B;AAC1B,kDAAgC;AAChC,uDAAqC;AACrC,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb;;;GAGG;AACH,uCASoB;AARhB,uGAAA,WAAW,OAAA;AACX,mGAAA,OAAO,OAAA;AACP,yGAAA,aAAa,OAAA;AACb,iGAAA,KAAK,OAAA"}
package/bin/index.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  /**
2
2
  * ECS Framework - 轻量级实体组件系统框架
3
3
  * 适用于Laya、Cocos等游戏引擎的小游戏开发
4
- * @version 2.0.0
5
- * @author ECS Framework Team
6
4
  */
7
5
  export { Core } from './Core';
8
6
  export { CoreEvents } from './ECS/CoreEvents';
@@ -15,5 +13,6 @@ export * from './ECS';
15
13
  export * from './Utils/Pool';
16
14
  export * from './Utils/PerformanceMonitor';
17
15
  export * from './Utils/Extensions';
16
+ export { WasmEcsCore, ecsCore, initializeEcs, Query, EntityId, ComponentMask, QueryResult } from './Utils/WasmCore';
18
17
  export * from './Types';
19
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C,cAAc,OAAO,CAAC;AAGtB,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AAGnC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C,cAAc,OAAO,CAAC;AAGtB,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AAGnC,OAAO,EACH,WAAW,EACX,OAAO,EACP,aAAa,EACb,KAAK,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACd,MAAM,kBAAkB,CAAC;AAG1B,cAAc,SAAS,CAAC"}
package/bin/index.js CHANGED
@@ -1,23 +1,51 @@
1
+ "use strict";
1
2
  /**
2
3
  * ECS Framework - 轻量级实体组件系统框架
3
4
  * 适用于Laya、Cocos等游戏引擎的小游戏开发
4
- * @version 2.0.0
5
- * @author ECS Framework Team
6
5
  */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.Query = exports.initializeEcs = exports.ecsCore = exports.WasmEcsCore = exports.Timer = exports.TimerManager = exports.GlobalManager = exports.FuncPack = exports.Emitter = exports.CoreEvents = exports.Core = void 0;
7
22
  // 核心模块
8
- export { Core } from './Core';
23
+ var Core_1 = require("./Core");
24
+ Object.defineProperty(exports, "Core", { enumerable: true, get: function () { return Core_1.Core; } });
9
25
  // 核心事件和管理器
10
- export { CoreEvents } from './ECS/CoreEvents';
11
- export { Emitter, FuncPack } from './Utils/Emitter';
12
- export { GlobalManager } from './Utils/GlobalManager';
13
- export { TimerManager } from './Utils/Timers/TimerManager';
14
- export { Timer } from './Utils/Timers/Timer';
15
- // ECS核心
16
- export * from './ECS';
26
+ var CoreEvents_1 = require("./ECS/CoreEvents");
27
+ Object.defineProperty(exports, "CoreEvents", { enumerable: true, get: function () { return CoreEvents_1.CoreEvents; } });
28
+ var Emitter_1 = require("./Utils/Emitter");
29
+ Object.defineProperty(exports, "Emitter", { enumerable: true, get: function () { return Emitter_1.Emitter; } });
30
+ Object.defineProperty(exports, "FuncPack", { enumerable: true, get: function () { return Emitter_1.FuncPack; } });
31
+ var GlobalManager_1 = require("./Utils/GlobalManager");
32
+ Object.defineProperty(exports, "GlobalManager", { enumerable: true, get: function () { return GlobalManager_1.GlobalManager; } });
33
+ var TimerManager_1 = require("./Utils/Timers/TimerManager");
34
+ Object.defineProperty(exports, "TimerManager", { enumerable: true, get: function () { return TimerManager_1.TimerManager; } });
35
+ var Timer_1 = require("./Utils/Timers/Timer");
36
+ Object.defineProperty(exports, "Timer", { enumerable: true, get: function () { return Timer_1.Timer; } });
37
+ // ECS核心组件
38
+ __exportStar(require("./ECS"), exports);
17
39
  // 工具类
18
- export * from './Utils/Pool';
19
- export * from './Utils/PerformanceMonitor';
20
- export * from './Utils/Extensions';
40
+ __exportStar(require("./Utils/Pool"), exports);
41
+ __exportStar(require("./Utils/PerformanceMonitor"), exports);
42
+ __exportStar(require("./Utils/Extensions"), exports);
43
+ // WebAssembly核心模块
44
+ var WasmCore_1 = require("./Utils/WasmCore");
45
+ Object.defineProperty(exports, "WasmEcsCore", { enumerable: true, get: function () { return WasmCore_1.WasmEcsCore; } });
46
+ Object.defineProperty(exports, "ecsCore", { enumerable: true, get: function () { return WasmCore_1.ecsCore; } });
47
+ Object.defineProperty(exports, "initializeEcs", { enumerable: true, get: function () { return WasmCore_1.initializeEcs; } });
48
+ Object.defineProperty(exports, "Query", { enumerable: true, get: function () { return WasmCore_1.Query; } });
21
49
  // 类型定义
22
- export * from './Types';
50
+ __exportStar(require("./Types"), exports);
23
51
  //# sourceMappingURL=index.js.map
package/bin/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO;AACP,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,WAAW;AACX,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,QAAQ;AACR,cAAc,OAAO,CAAC;AAEtB,MAAM;AACN,cAAc,cAAc,CAAC;AAC7B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AAEnC,OAAO;AACP,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;AAEH,OAAO;AACP,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AAEb,WAAW;AACX,+CAA8C;AAArC,wGAAA,UAAU,OAAA;AACnB,2CAAoD;AAA3C,kGAAA,OAAO,OAAA;AAAE,mGAAA,QAAQ,OAAA;AAC1B,uDAAsD;AAA7C,8GAAA,aAAa,OAAA;AACtB,4DAA2D;AAAlD,4GAAA,YAAY,OAAA;AAErB,8CAA6C;AAApC,8FAAA,KAAK,OAAA;AAEd,UAAU;AACV,wCAAsB;AAEtB,MAAM;AACN,+CAA6B;AAC7B,6DAA2C;AAC3C,qDAAmC;AAEnC,kBAAkB;AAClB,6CAQ0B;AAPtB,uGAAA,WAAW,OAAA;AACX,mGAAA,OAAO,OAAA;AACP,yGAAA,aAAa,OAAA;AACb,iGAAA,KAAK,OAAA;AAMT,OAAO;AACP,0CAAwB"}
package/package.json CHANGED
@@ -1,74 +1,58 @@
1
- {
2
- "name": "@esengine/ecs-framework",
3
- "version": "2.0.6",
4
- "description": "用于Laya、Cocos等游戏引擎的高性能ECS框架",
5
- "main": "bin/index.js",
6
- "types": "bin/index.d.ts",
7
- "files": [
8
- "bin/**/*",
9
- "README.md",
10
- "LICENSE"
11
- ],
12
- "keywords": [
13
- "ecs",
14
- "entity-component-system",
15
- "game-engine",
16
- "typescript",
17
- "laya",
18
- "cocos",
19
- "egret"
20
- ],
21
- "scripts": {
22
- "build": "tsc",
23
- "build:watch": "tsc --watch",
24
- "build:dev": "tsc -p tsconfig.dev.json",
25
- "build:dev:watch": "tsc -p tsconfig.dev.json --watch",
26
- "clean": "rimraf bin",
27
- "clean:dev": "rimraf dev-bin",
28
- "clean:all": "rimraf bin dev-bin",
29
- "rebuild": "npm run clean && npm run build",
30
- "rebuild:dev": "npm run clean:dev && npm run build:dev",
31
- "test": "jest",
32
- "test:watch": "jest --watch",
33
- "test:coverage": "jest --coverage",
34
- "test:framework:benchmark": "npm run build:dev && node dev-bin/Testing/framework-benchmark-test.js",
35
- "lint": "eslint src --ext .ts",
36
- "lint:fix": "eslint src --ext .ts --fix",
37
- "prepublishOnly": "npm run rebuild",
38
- "publish:patch": "npm run rebuild && npm version patch && npm publish",
39
- "publish:minor": "npm run rebuild && npm version minor && npm publish",
40
- "publish:major": "npm run rebuild && npm version major && npm publish",
41
- "pack:check": "npm run rebuild && npm pack --dry-run",
42
- "check": "node scripts/check-publish.js"
43
- },
44
- "author": "yhh",
45
- "license": "MIT",
46
- "devDependencies": {
47
- "@babel/core": "^7.27.4",
48
- "@babel/preset-env": "^7.27.2",
49
- "browserify": "^17.0.1",
50
- "gulp": "^5.0.1",
51
- "gulp-babel": "^8.0.0",
52
- "gulp-concat": "^2.6.1",
53
- "gulp-inject-string": "^1.1.2",
54
- "gulp-terser": "^2.1.0",
55
- "gulp-string-replace": "^1.1.2",
56
- "gulp-typescript": "^6.0.0-alpha.1",
57
- "gulp-uglify": "^3.0.2",
58
- "merge2": "^1.4.1",
59
- "rimraf": "^5.0.0",
60
- "tsify": "^5.0.4",
61
- "typedoc": "^0.28.5",
62
- "typescript": "^5.8.3",
63
- "vinyl-source-stream": "^2.0.0",
64
- "watchify": "^4.0.0"
65
- },
66
- "publishConfig": {
67
- "access": "public"
68
- },
69
- "repository": {
70
- "type": "git",
71
- "url": "https://github.com/esengine/ecs-framework.git"
72
- },
73
- "dependencies": {}
74
- }
1
+ {
2
+ "name": "@esengine/ecs-framework",
3
+ "version": "2.0.8",
4
+ "description": "用于Laya、Cocos等游戏引擎的高性能ECS框架",
5
+ "main": "bin/index.js",
6
+ "types": "bin/index.d.ts",
7
+ "files": [
8
+ "bin/**/*",
9
+ "src/wasm/rust-ecs-core/pkg/**/*",
10
+ "README.md",
11
+ "LICENSE"
12
+ ],
13
+ "keywords": [
14
+ "ecs",
15
+ "entity-component-system",
16
+ "game-engine",
17
+ "typescript",
18
+ "laya",
19
+ "cocos",
20
+ "egret"
21
+ ],
22
+ "scripts": {
23
+ "clean": "rimraf bin wasm",
24
+ "clean:wasm": "rimraf src/wasm/rust-ecs-core/pkg src/wasm/rust-ecs-core/target",
25
+ "build:wasm": "cd src/wasm/rust-ecs-core && wasm-pack build --target web --out-dir pkg --release",
26
+ "build:ts": "tsc",
27
+ "prebuild": "npm run clean",
28
+ "build": "npm run build:wasm && npm run build:ts",
29
+ "build:watch": "tsc --watch",
30
+ "rebuild": "npm run clean && npm run clean:wasm && npm run build",
31
+ "test:benchmark": "npm run build && node bin/Testing/Performance/benchmark.js",
32
+ "test:unit": "npm run build && node bin/Testing/test-runner.js",
33
+ "benchmark": "node scripts/benchmark.js",
34
+ "prepublishOnly": "npm run rebuild",
35
+ "version:patch": "npm version patch",
36
+ "version:minor": "npm version minor",
37
+ "version:major": "npm version major",
38
+ "publish:patch": "npm run version:patch && npm publish",
39
+ "publish:minor": "npm run version:minor && npm publish",
40
+ "publish:major": "npm run version:major && npm publish",
41
+ "publish": "npm publish"
42
+ },
43
+ "author": "yhh",
44
+ "license": "MIT",
45
+ "devDependencies": {
46
+ "@types/node": "^20.19.0",
47
+ "rimraf": "^5.0.0",
48
+ "typescript": "^5.8.3"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "repository": {
54
+ "type": "git",
55
+ "url": "https://github.com/esengine/ecs-framework.git"
56
+ },
57
+ "optionalDependencies": {}
58
+ }
@@ -1,192 +0,0 @@
1
- /**
2
- * ECS框架加速提供者接口
3
- *
4
- * 提供可替换的性能加速实现,专注于ECS实体查询功能
5
- * 支持JavaScript、WebAssembly等不同后端实现
6
- */
7
- /**
8
- * 实体查询结果
9
- */
10
- export interface QueryResult {
11
- /** 查询到的实体ID数组 */
12
- entities: Uint32Array;
13
- /** 查询到的实体数量 */
14
- count: number;
15
- }
16
- /**
17
- * 实体查询接口
18
- *
19
- * 提供高性能的ECS实体查询功能
20
- */
21
- export interface QueryProvider {
22
- /**
23
- * 根据单个组件掩码查询实体
24
- * @param componentMask 组件掩码
25
- * @param maxResults 最大结果数量
26
- * @returns 查询结果
27
- */
28
- queryByComponent(componentMask: bigint, maxResults: number): QueryResult;
29
- /**
30
- * 根据多个组件掩码查询实体(AND操作)
31
- * @param componentMasks 组件掩码数组
32
- * @param maxResults 最大结果数量
33
- * @returns 查询结果
34
- */
35
- queryByComponents(componentMasks: bigint[], maxResults: number): QueryResult;
36
- /**
37
- * 查询包含指定组件但排除其他组件的实体
38
- * @param includeMask 必须包含的组件掩码
39
- * @param excludeMask 必须排除的组件掩码
40
- * @param maxResults 最大结果数量
41
- * @returns 查询结果
42
- */
43
- queryExcluding(includeMask: bigint, excludeMask: bigint, maxResults: number): QueryResult;
44
- /**
45
- * 更新实体的组件掩码
46
- * @param entityId 实体ID
47
- * @param componentMask 新的组件掩码
48
- */
49
- updateEntityMask(entityId: number, componentMask: bigint): void;
50
- /**
51
- * 批量更新实体掩码
52
- * @param entityIds 实体ID数组
53
- * @param masks 掩码数组
54
- */
55
- batchUpdateMasks(entityIds: Uint32Array, masks: BigUint64Array): void;
56
- }
57
- /**
58
- * 加速提供者接口
59
- *
60
- * 定义了ECS框架加速提供者的基本契约
61
- */
62
- export interface AccelerationProvider {
63
- /** 提供者名称 */
64
- readonly name: string;
65
- /** 提供者版本 */
66
- readonly version: string;
67
- /** 是否为WebAssembly实现 */
68
- readonly isWasm: boolean;
69
- /** 实体查询功能模块 */
70
- query: QueryProvider;
71
- /**
72
- * 初始化提供者
73
- * @throws {Error} 初始化失败时抛出错误
74
- */
75
- initialize(): Promise<void>;
76
- /**
77
- * 检查是否支持指定功能
78
- * @param feature 功能名称
79
- * @returns 是否支持该功能
80
- */
81
- supports(feature: string): boolean;
82
- /**
83
- * 获取性能信息
84
- * @returns 性能统计信息
85
- */
86
- getPerformanceInfo(): {
87
- /** 每秒操作数 */
88
- operationsPerSecond: number;
89
- /** 内存使用量(字节) */
90
- memoryUsage: number;
91
- /** 支持的功能列表 */
92
- features: string[];
93
- };
94
- /**
95
- * 清理资源
96
- */
97
- dispose(): void;
98
- }
99
- /**
100
- * JavaScript实现的基础加速提供者
101
- *
102
- * 提供纯JavaScript的ECS查询实现,作为默认后端
103
- */
104
- export declare class JavaScriptProvider implements AccelerationProvider {
105
- readonly name = "JavaScript";
106
- readonly version = "1.0.0";
107
- readonly isWasm = false;
108
- /** 实体查询功能模块 */
109
- query: QueryProvider;
110
- /**
111
- * 构造函数
112
- */
113
- constructor();
114
- /**
115
- * 初始化提供者
116
- */
117
- initialize(): Promise<void>;
118
- /**
119
- * 检查是否支持指定功能
120
- * @param feature 功能名称
121
- * @returns 是否支持该功能
122
- */
123
- supports(feature: string): boolean;
124
- /**
125
- * 获取性能信息
126
- * @returns 性能统计信息
127
- */
128
- getPerformanceInfo(): {
129
- operationsPerSecond: number;
130
- memoryUsage: number;
131
- features: string[];
132
- };
133
- /**
134
- * 清理资源
135
- */
136
- dispose(): void;
137
- }
138
- /**
139
- * 加速提供者管理器
140
- *
141
- * 管理不同的加速提供者实现,支持动态切换和性能测试
142
- */
143
- export declare class AccelerationManager {
144
- /** 单例实例 */
145
- private static instance;
146
- /** 当前使用的提供者 */
147
- private currentProvider;
148
- /** 可用的提供者映射 */
149
- private availableProviders;
150
- /**
151
- * 私有构造函数
152
- */
153
- private constructor();
154
- /**
155
- * 获取单例实例
156
- * @returns 管理器实例
157
- */
158
- static getInstance(): AccelerationManager;
159
- /**
160
- * 注册新的加速提供者
161
- * @param name 提供者名称
162
- * @param provider 提供者实例
163
- */
164
- registerProvider(name: string, provider: AccelerationProvider): void;
165
- /**
166
- * 切换加速提供者
167
- * @param name 提供者名称
168
- * @returns 是否切换成功
169
- */
170
- setProvider(name: string): Promise<boolean>;
171
- /**
172
- * 获取当前提供者
173
- * @returns 当前提供者实例
174
- */
175
- getProvider(): AccelerationProvider;
176
- /**
177
- * 获取所有可用提供者名称
178
- * @returns 提供者名称数组
179
- */
180
- getAvailableProviders(): string[];
181
- /**
182
- * 自动选择最佳提供者
183
- * 优先选择WebAssembly提供者,回退到JavaScript提供者
184
- */
185
- selectBestProvider(): Promise<void>;
186
- /**
187
- * 性能基准测试
188
- * @returns 各提供者的性能测试结果(操作/秒)
189
- */
190
- benchmarkProviders(): Promise<Map<string, number>>;
191
- }
192
- //# sourceMappingURL=AccelerationProvider.d.ts.map
@@ -1 +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