@awesome-ecs/abstract 0.20.2 → 0.21.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 (60) hide show
  1. package/README.md +129 -0
  2. package/dist/components/index.cjs +10 -32
  3. package/dist/components/index.cjs.map +1 -1
  4. package/dist/components/index.d.cts +3 -2
  5. package/dist/components/index.d.ts +3 -2
  6. package/dist/components/index.js +11 -8
  7. package/dist/components/index.js.map +1 -1
  8. package/dist/entities/index.cjs +11 -33
  9. package/dist/entities/index.cjs.map +1 -1
  10. package/dist/entities/index.d.cts +4 -34
  11. package/dist/entities/index.d.ts +4 -34
  12. package/dist/entities/index.js +12 -9
  13. package/dist/entities/index.js.map +1 -1
  14. package/dist/factories/index.cjs +0 -18
  15. package/dist/factories/index.d.cts +44 -44
  16. package/dist/factories/index.d.ts +44 -44
  17. package/dist/factories/index.js +0 -1
  18. package/dist/identity-component-BDWEtAXA.d.cts +238 -0
  19. package/dist/identity-component-CR1ULadR.d.ts +238 -0
  20. package/dist/index-C3UGZqUG.d.ts +288 -0
  21. package/dist/index-CKh4A7mH.d.cts +460 -0
  22. package/dist/index-ChV4Q5j6.d.cts +137 -0
  23. package/dist/index-Cm-YSPhK.d.ts +254 -0
  24. package/dist/index-D81Fo9XN.d.cts +254 -0
  25. package/dist/index-DLm-DKAk.d.cts +288 -0
  26. package/dist/index-oenqxDCa.d.ts +137 -0
  27. package/dist/index-zpj0YApu.d.ts +460 -0
  28. package/dist/pipelines/index.cjs +28 -35
  29. package/dist/pipelines/index.cjs.map +1 -1
  30. package/dist/pipelines/index.d.cts +4 -56
  31. package/dist/pipelines/index.d.ts +4 -56
  32. package/dist/pipelines/index.js +29 -11
  33. package/dist/pipelines/index.js.map +1 -1
  34. package/dist/systems/index.cjs +31 -35
  35. package/dist/systems/index.cjs.map +1 -1
  36. package/dist/systems/index.d.cts +7 -101
  37. package/dist/systems/index.d.ts +7 -101
  38. package/dist/systems/index.js +32 -11
  39. package/dist/systems/index.js.map +1 -1
  40. package/dist/{types-cZ-1lGPD.d.ts → types-DvzdpbLu.d.cts} +9 -17
  41. package/dist/{types-cZ-1lGPD.d.cts → types-yh4pOGEm.d.ts} +9 -17
  42. package/dist/utils/index.cjs +25 -35
  43. package/dist/utils/index.cjs.map +1 -1
  44. package/dist/utils/index.d.cts +3 -92
  45. package/dist/utils/index.d.ts +3 -92
  46. package/dist/utils/index.js +26 -11
  47. package/dist/utils/index.js.map +1 -1
  48. package/package.json +3 -3
  49. package/dist/entity-repository-BlSpo-x2.d.ts +0 -253
  50. package/dist/entity-repository-DJ1xbvaN.d.cts +0 -253
  51. package/dist/factories/index.cjs.map +0 -1
  52. package/dist/factories/index.js.map +0 -1
  53. package/dist/index-B1KXekZD.d.ts +0 -199
  54. package/dist/index-CnlpX7ys.d.cts +0 -199
  55. package/dist/performance-timer-BVyl0SRs.d.cts +0 -45
  56. package/dist/performance-timer-BVyl0SRs.d.ts +0 -45
  57. package/dist/pipeline-BGsQiSer.d.ts +0 -161
  58. package/dist/pipeline-DunwPUPZ.d.cts +0 -161
  59. package/dist/systems-runtime-context-BTNdV8Z-.d.ts +0 -330
  60. package/dist/systems-runtime-context-DhtHMczN.d.cts +0 -330
@@ -1,12 +1,30 @@
1
- // src/pipelines/pipeline-status.ts
2
- var PipelineStatus = /* @__PURE__ */ ((PipelineStatus2) => {
3
- PipelineStatus2["idle"] = "idle";
4
- PipelineStatus2["ongoing"] = "ongoing";
5
- PipelineStatus2["completed"] = "completed";
6
- PipelineStatus2["halted"] = "halted";
7
- return PipelineStatus2;
8
- })(PipelineStatus || {});
9
- export {
10
- PipelineStatus
11
- };
1
+ //#region src/pipelines/pipeline-status.ts
2
+ /**
3
+ * The PipelineStatus enum represents the different states a pipeline can be in.
4
+ *
5
+ * @remarks
6
+ * This enum is used to track the current status of the pipeline.
7
+ */
8
+ let PipelineStatus = /* @__PURE__ */ function(PipelineStatus$1) {
9
+ /**
10
+ * The pipeline is currently idle and not processing any tasks.
11
+ */
12
+ PipelineStatus$1["idle"] = "idle";
13
+ /**
14
+ * The pipeline is currently processing tasks.
15
+ */
16
+ PipelineStatus$1["ongoing"] = "ongoing";
17
+ /**
18
+ * The pipeline has completed all tasks successfully.
19
+ */
20
+ PipelineStatus$1["completed"] = "completed";
21
+ /**
22
+ * The pipeline has been halted due to an error or middleware intervention.
23
+ */
24
+ PipelineStatus$1["halted"] = "halted";
25
+ return PipelineStatus$1;
26
+ }({});
27
+
28
+ //#endregion
29
+ export { PipelineStatus };
12
30
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/pipelines/pipeline-status.ts"],"sourcesContent":["/**\n * The PipelineStatus enum represents the different states a pipeline can be in.\n *\n * @remarks\n * This enum is used to track the current status of the pipeline.\n */\nexport enum PipelineStatus {\n /**\n * The pipeline is currently idle and not processing any tasks.\n */\n idle = 'idle',\n\n /**\n * The pipeline is currently processing tasks.\n */\n ongoing = 'ongoing',\n\n /**\n * The pipeline has completed all tasks successfully.\n */\n completed = 'completed',\n\n /**\n * The pipeline has been halted due to an error or middleware intervention.\n */\n halted = 'halted'\n}\n"],"mappings":";AAMO,IAAK,iBAAL,kBAAKA,oBAAL;AAIL,EAAAA,gBAAA,UAAO;AAKP,EAAAA,gBAAA,aAAU;AAKV,EAAAA,gBAAA,eAAY;AAKZ,EAAAA,gBAAA,YAAS;AAnBC,SAAAA;AAAA,GAAA;","names":["PipelineStatus"]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/pipelines/pipeline-status.ts"],"sourcesContent":["/**\n * The PipelineStatus enum represents the different states a pipeline can be in.\n *\n * @remarks\n * This enum is used to track the current status of the pipeline.\n */\nexport enum PipelineStatus {\n /**\n * The pipeline is currently idle and not processing any tasks.\n */\n idle = 'idle',\n\n /**\n * The pipeline is currently processing tasks.\n */\n ongoing = 'ongoing',\n\n /**\n * The pipeline has completed all tasks successfully.\n */\n completed = 'completed',\n\n /**\n * The pipeline has been halted due to an error or middleware intervention.\n */\n halted = 'halted'\n}\n"],"mappings":";;;;;;;AAMA,IAAY,4DAAL;;;;AAIL;;;;AAKA;;;;AAKA;;;;AAKA;;AACD"}
@@ -1,38 +1,34 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
1
 
19
- // src/systems/index.ts
20
- var systems_exports = {};
21
- __export(systems_exports, {
22
- SystemType: () => SystemType
23
- });
24
- module.exports = __toCommonJS(systems_exports);
2
+ //#region src/systems/module/system-type.ts
3
+ /**
4
+ * Enum representing the built-in System pipeline types.
5
+ * These types can be extended to introduce more types, and the System Runtime Pipeline should
6
+ * add Middleware to handle the newly added types.
7
+ */
8
+ let SystemType = /* @__PURE__ */ function(SystemType$1) {
9
+ /**
10
+ * The initialization phase of the Module pipeline.
11
+ * This phase is typically used for setting up initial state and resources.
12
+ */
13
+ SystemType$1["initialize"] = "initialize";
14
+ /**
15
+ * The update phase of the Module pipeline.
16
+ * This phase is responsible for updating the game logic and state of entities.
17
+ */
18
+ SystemType$1["update"] = "update";
19
+ /**
20
+ * The render phase of the Module pipeline.
21
+ * This phase is used for rendering the game to the screen.
22
+ */
23
+ SystemType$1["render"] = "render";
24
+ /**
25
+ * The synchronization phase of the Module pipeline.
26
+ * This phase is used for synchronizing game state with external systems or other components.
27
+ */
28
+ SystemType$1["sync"] = "sync";
29
+ return SystemType$1;
30
+ }({});
25
31
 
26
- // src/systems/module/system-type.ts
27
- var SystemType = /* @__PURE__ */ ((SystemType2) => {
28
- SystemType2["initialize"] = "initialize";
29
- SystemType2["update"] = "update";
30
- SystemType2["render"] = "render";
31
- SystemType2["sync"] = "sync";
32
- return SystemType2;
33
- })(SystemType || {});
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- SystemType
37
- });
32
+ //#endregion
33
+ exports.SystemType = SystemType;
38
34
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/systems/index.ts","../../src/systems/module/system-type.ts"],"sourcesContent":["export * from './pipeline/system-context-entity';\nexport * from './pipeline/system-context-events';\nexport * from './pipeline/system-context-proxies';\nexport * from './pipeline/system-context-repository';\nexport * from './pipeline/system-context-scheduler';\nexport * from './pipeline/system-context-snapshot';\nexport * from './runtime/systems-runtime-context';\nexport * from './runtime/systems-runtime-middleware';\nexport * from './pipeline/system-middleware';\nexport * from './pipeline/system-context';\nexport * from './module/system-type';\nexport * from './module/systems-module';\nexport * from './module/systems-module-repository';\nexport * from './runtime/systems-runtime';\n","/**\n * Enum representing the built-in System pipeline types.\n * These types can be extended to introduce more types, and the System Runtime Pipeline should\n * add Middleware to handle the newly added types.\n */\nexport enum SystemType {\n /**\n * The initialization phase of the Module pipeline.\n * This phase is typically used for setting up initial state and resources.\n */\n initialize = 'initialize',\n\n /**\n * The update phase of the Module pipeline.\n * This phase is responsible for updating the game logic and state of entities.\n */\n update = 'update',\n\n /**\n * The render phase of the Module pipeline.\n * This phase is used for rendering the game to the screen.\n */\n render = 'render',\n\n /**\n * The synchronization phase of the Module pipeline.\n * This phase is used for synchronizing game state with external systems or other components.\n */\n sync = 'sync'\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAK,aAAL,kBAAKA,gBAAL;AAKL,EAAAA,YAAA,gBAAa;AAMb,EAAAA,YAAA,YAAS;AAMT,EAAAA,YAAA,YAAS;AAMT,EAAAA,YAAA,UAAO;AAvBG,SAAAA;AAAA,GAAA;","names":["SystemType"]}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/systems/module/system-type.ts"],"sourcesContent":["/**\n * Enum representing the built-in System pipeline types.\n * These types can be extended to introduce more types, and the System Runtime Pipeline should\n * add Middleware to handle the newly added types.\n */\nexport enum SystemType {\n /**\n * The initialization phase of the Module pipeline.\n * This phase is typically used for setting up initial state and resources.\n */\n initialize = 'initialize',\n\n /**\n * The update phase of the Module pipeline.\n * This phase is responsible for updating the game logic and state of entities.\n */\n update = 'update',\n\n /**\n * The render phase of the Module pipeline.\n * This phase is used for rendering the game to the screen.\n */\n render = 'render',\n\n /**\n * The synchronization phase of the Module pipeline.\n * This phase is used for synchronizing game state with external systems or other components.\n */\n sync = 'sync'\n}\n"],"mappings":";;;;;;;AAKA,IAAY,oDAAL;;;;;AAKL;;;;;AAMA;;;;;AAMA;;;;;AAMA;;AACD"}
@@ -1,101 +1,7 @@
1
- import { I as ISystemsRuntimeContext, a as ISystemContext, S as SystemType } from '../systems-runtime-context-DhtHMczN.cjs';
2
- export { b as ISystemContextEntity, c as ISystemContextEvents, d as ISystemContextProxies, e as ISystemContextRepository, f as ISystemContextScheduler, g as ISystemContextSnapshot } from '../systems-runtime-context-DhtHMczN.cjs';
3
- import { c as IEntity, E as EntityTypeUid } from '../index-CnlpX7ys.cjs';
4
- import { b as IMiddleware, P as PipelineResult } from '../pipeline-DunwPUPZ.cjs';
5
- import { f as IEntityUpdate } from '../entity-repository-DJ1xbvaN.cjs';
6
- import { I as Immutable } from '../types-cZ-1lGPD.cjs';
7
- import '../utils/index.cjs';
8
- import '../performance-timer-BVyl0SRs.cjs';
9
-
10
- /**
11
- * The `ISystemsRuntimeMiddleware` represents the building blocks of executing SystemsModule's registered Pipelines.
12
- * It receives the current State in the Context, and can decide which SystemPipelines to execute.
13
- *
14
- * @typeParam TEntity - The type of entity that the middleware operates on.
15
- * @extends {IMiddleware<ISystemsRuntimeContext<TEntity>>} - Extends the base `IMiddleware` interface, which is used for defining middleware functions.
16
- */
17
- type ISystemsRuntimeMiddleware<TEntity extends IEntity> = IMiddleware<ISystemsRuntimeContext<TEntity>>;
18
-
19
- /**
20
- * The `ISystemMiddleware` is a basic System implementation that can be registered as a Middleware in a SystemPipeline.
21
- * It provides a `SystemPipelineContext` to its exposed methods.
22
- *
23
- * @template TEntity - The type of entity that this middleware operates on.
24
- * @extends {IMiddleware<ISystemContext<TEntity>>} - Extends the base `IMiddleware` interface, which requires a `SystemPipelineContext` to be provided.
25
- */
26
- type ISystemMiddleware<TEntity extends IEntity> = IMiddleware<ISystemContext<TEntity>>;
27
-
28
- /**
29
- * The SystemModule is the main way of registering and triggering the SystemMiddlewares registered for an Entity.
30
- * It can handle EntityUpdate objects and decides which SystemPipelines to trigger based on the information in the EntityUpdate.
31
- */
32
- interface ISystemsModule<TEntity extends IEntity> {
33
- /**
34
- * Registers SystemMiddlewares to the specified SystemPipelineType.
35
- *
36
- * @param type - The SystemPipelineType to append the provided SystemMiddlewares to.
37
- * @param systems - The SystemMiddlewares to be registered in the provided SystemPipelineType in the same order as the provided array.
38
- * The SystemMiddlewares will be appended to existing Pipelines to allow easy extension of existing behaviors.
39
- */
40
- registerSystems?(type: SystemType, systems: ISystemMiddleware<TEntity>[]): void;
41
- /**
42
- * Triggers all registered SystemPipelines to apply the changes from the provided EntityUpdate to an Entity instance.
43
- *
44
- * @param update - The EntityUpdate containing the desired changes to be applied on an Entity instance.
45
- * @returns A PipelineResult indicating the success or failure of the triggered SystemPipelines.
46
- */
47
- triggerSystems(update: IEntityUpdate): PipelineResult;
48
- }
49
-
50
- /**
51
- * Interface for managing systems modules.
52
- *
53
- * @template TEntity - The type of entity that the systems module operates on.
54
- */
55
- interface ISystemsModuleRepository {
56
- /**
57
- * The number of systems modules in the repository.
58
- */
59
- readonly size: number;
60
- /**
61
- * Retrieves a systems module for a specific entity type.
62
- *
63
- * @param type - The unique identifier of the entity type.
64
- * @returns The systems module for the specified entity type.
65
- */
66
- get<TEntity extends IEntity>(type: EntityTypeUid): ISystemsModule<TEntity>;
67
- /**
68
- * Adds or updates a systems module for a specific entity type.
69
- *
70
- * @param type - The unique identifier of the entity type.
71
- * @param module - The systems module to add or update.
72
- */
73
- set(type: EntityTypeUid, module: ISystemsModule<IEntity>): void;
74
- /**
75
- * Retrieves a read-only map of all systems modules in the repository.
76
- *
77
- * @returns A read-only map of entity type unique identifiers to systems modules.
78
- */
79
- list(): ReadonlyMap<EntityTypeUid, Immutable<ISystemsModule<IEntity>>>;
80
- }
81
-
82
- /**
83
- * The System Runtime allows running a loop of Ticks.
84
- *
85
- * Each `runTick` method can process one or more Entity Updates.
86
- *
87
- * We can have multiple implementations of a `SystemsRuntime`, based on the use-case.
88
- * A different implementation can be chosen at runtime, based for example on performance.
89
- */
90
- interface ISystemsRuntime {
91
- /**
92
- * The method should trigger the SystemsModule logic for the provided `IEntityUpdate`.
93
- * If no EntityUpdate is given, the `SystemRuntime` implementation can choose to dequeue one from the `IEntityUpdateQueue`.
94
- *
95
- * @param update - An optional `IEntityUpdate` to process. If not provided, the method will dequeue one from the `IEntityUpdateQueue`.
96
- * @returns A `PipelineResult` representing the outcome of the SystemsModule logic execution.
97
- */
98
- runTick(update?: IEntityUpdate): PipelineResult;
99
- }
100
-
101
- export { ISystemContext, type ISystemMiddleware, type ISystemsModule, type ISystemsModuleRepository, type ISystemsRuntime, ISystemsRuntimeContext, type ISystemsRuntimeMiddleware, SystemType };
1
+ import "../identity-component-BDWEtAXA.cjs";
2
+ import "../types-DvzdpbLu.cjs";
3
+ import "../index-DLm-DKAk.cjs";
4
+ import "../index-D81Fo9XN.cjs";
5
+ import "../index-ChV4Q5j6.cjs";
6
+ import { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleDefinition, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType } from "../index-CKh4A7mH.cjs";
7
+ export { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleDefinition, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
@@ -1,101 +1,7 @@
1
- import { I as ISystemsRuntimeContext, a as ISystemContext, S as SystemType } from '../systems-runtime-context-BTNdV8Z-.js';
2
- export { b as ISystemContextEntity, c as ISystemContextEvents, d as ISystemContextProxies, e as ISystemContextRepository, f as ISystemContextScheduler, g as ISystemContextSnapshot } from '../systems-runtime-context-BTNdV8Z-.js';
3
- import { c as IEntity, E as EntityTypeUid } from '../index-B1KXekZD.js';
4
- import { b as IMiddleware, P as PipelineResult } from '../pipeline-BGsQiSer.js';
5
- import { f as IEntityUpdate } from '../entity-repository-BlSpo-x2.js';
6
- import { I as Immutable } from '../types-cZ-1lGPD.js';
7
- import '../utils/index.js';
8
- import '../performance-timer-BVyl0SRs.js';
9
-
10
- /**
11
- * The `ISystemsRuntimeMiddleware` represents the building blocks of executing SystemsModule's registered Pipelines.
12
- * It receives the current State in the Context, and can decide which SystemPipelines to execute.
13
- *
14
- * @typeParam TEntity - The type of entity that the middleware operates on.
15
- * @extends {IMiddleware<ISystemsRuntimeContext<TEntity>>} - Extends the base `IMiddleware` interface, which is used for defining middleware functions.
16
- */
17
- type ISystemsRuntimeMiddleware<TEntity extends IEntity> = IMiddleware<ISystemsRuntimeContext<TEntity>>;
18
-
19
- /**
20
- * The `ISystemMiddleware` is a basic System implementation that can be registered as a Middleware in a SystemPipeline.
21
- * It provides a `SystemPipelineContext` to its exposed methods.
22
- *
23
- * @template TEntity - The type of entity that this middleware operates on.
24
- * @extends {IMiddleware<ISystemContext<TEntity>>} - Extends the base `IMiddleware` interface, which requires a `SystemPipelineContext` to be provided.
25
- */
26
- type ISystemMiddleware<TEntity extends IEntity> = IMiddleware<ISystemContext<TEntity>>;
27
-
28
- /**
29
- * The SystemModule is the main way of registering and triggering the SystemMiddlewares registered for an Entity.
30
- * It can handle EntityUpdate objects and decides which SystemPipelines to trigger based on the information in the EntityUpdate.
31
- */
32
- interface ISystemsModule<TEntity extends IEntity> {
33
- /**
34
- * Registers SystemMiddlewares to the specified SystemPipelineType.
35
- *
36
- * @param type - The SystemPipelineType to append the provided SystemMiddlewares to.
37
- * @param systems - The SystemMiddlewares to be registered in the provided SystemPipelineType in the same order as the provided array.
38
- * The SystemMiddlewares will be appended to existing Pipelines to allow easy extension of existing behaviors.
39
- */
40
- registerSystems?(type: SystemType, systems: ISystemMiddleware<TEntity>[]): void;
41
- /**
42
- * Triggers all registered SystemPipelines to apply the changes from the provided EntityUpdate to an Entity instance.
43
- *
44
- * @param update - The EntityUpdate containing the desired changes to be applied on an Entity instance.
45
- * @returns A PipelineResult indicating the success or failure of the triggered SystemPipelines.
46
- */
47
- triggerSystems(update: IEntityUpdate): PipelineResult;
48
- }
49
-
50
- /**
51
- * Interface for managing systems modules.
52
- *
53
- * @template TEntity - The type of entity that the systems module operates on.
54
- */
55
- interface ISystemsModuleRepository {
56
- /**
57
- * The number of systems modules in the repository.
58
- */
59
- readonly size: number;
60
- /**
61
- * Retrieves a systems module for a specific entity type.
62
- *
63
- * @param type - The unique identifier of the entity type.
64
- * @returns The systems module for the specified entity type.
65
- */
66
- get<TEntity extends IEntity>(type: EntityTypeUid): ISystemsModule<TEntity>;
67
- /**
68
- * Adds or updates a systems module for a specific entity type.
69
- *
70
- * @param type - The unique identifier of the entity type.
71
- * @param module - The systems module to add or update.
72
- */
73
- set(type: EntityTypeUid, module: ISystemsModule<IEntity>): void;
74
- /**
75
- * Retrieves a read-only map of all systems modules in the repository.
76
- *
77
- * @returns A read-only map of entity type unique identifiers to systems modules.
78
- */
79
- list(): ReadonlyMap<EntityTypeUid, Immutable<ISystemsModule<IEntity>>>;
80
- }
81
-
82
- /**
83
- * The System Runtime allows running a loop of Ticks.
84
- *
85
- * Each `runTick` method can process one or more Entity Updates.
86
- *
87
- * We can have multiple implementations of a `SystemsRuntime`, based on the use-case.
88
- * A different implementation can be chosen at runtime, based for example on performance.
89
- */
90
- interface ISystemsRuntime {
91
- /**
92
- * The method should trigger the SystemsModule logic for the provided `IEntityUpdate`.
93
- * If no EntityUpdate is given, the `SystemRuntime` implementation can choose to dequeue one from the `IEntityUpdateQueue`.
94
- *
95
- * @param update - An optional `IEntityUpdate` to process. If not provided, the method will dequeue one from the `IEntityUpdateQueue`.
96
- * @returns A `PipelineResult` representing the outcome of the SystemsModule logic execution.
97
- */
98
- runTick(update?: IEntityUpdate): PipelineResult;
99
- }
100
-
101
- export { ISystemContext, type ISystemMiddleware, type ISystemsModule, type ISystemsModuleRepository, type ISystemsRuntime, ISystemsRuntimeContext, type ISystemsRuntimeMiddleware, SystemType };
1
+ import "../identity-component-CR1ULadR.js";
2
+ import "../types-yh4pOGEm.js";
3
+ import "../index-C3UGZqUG.js";
4
+ import "../index-Cm-YSPhK.js";
5
+ import "../index-oenqxDCa.js";
6
+ import { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleDefinition, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType } from "../index-zpj0YApu.js";
7
+ export { ISystemContext, ISystemContextEntity, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleDefinition, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
@@ -1,12 +1,33 @@
1
- // src/systems/module/system-type.ts
2
- var SystemType = /* @__PURE__ */ ((SystemType2) => {
3
- SystemType2["initialize"] = "initialize";
4
- SystemType2["update"] = "update";
5
- SystemType2["render"] = "render";
6
- SystemType2["sync"] = "sync";
7
- return SystemType2;
8
- })(SystemType || {});
9
- export {
10
- SystemType
11
- };
1
+ //#region src/systems/module/system-type.ts
2
+ /**
3
+ * Enum representing the built-in System pipeline types.
4
+ * These types can be extended to introduce more types, and the System Runtime Pipeline should
5
+ * add Middleware to handle the newly added types.
6
+ */
7
+ let SystemType = /* @__PURE__ */ function(SystemType$1) {
8
+ /**
9
+ * The initialization phase of the Module pipeline.
10
+ * This phase is typically used for setting up initial state and resources.
11
+ */
12
+ SystemType$1["initialize"] = "initialize";
13
+ /**
14
+ * The update phase of the Module pipeline.
15
+ * This phase is responsible for updating the game logic and state of entities.
16
+ */
17
+ SystemType$1["update"] = "update";
18
+ /**
19
+ * The render phase of the Module pipeline.
20
+ * This phase is used for rendering the game to the screen.
21
+ */
22
+ SystemType$1["render"] = "render";
23
+ /**
24
+ * The synchronization phase of the Module pipeline.
25
+ * This phase is used for synchronizing game state with external systems or other components.
26
+ */
27
+ SystemType$1["sync"] = "sync";
28
+ return SystemType$1;
29
+ }({});
30
+
31
+ //#endregion
32
+ export { SystemType };
12
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/systems/module/system-type.ts"],"sourcesContent":["/**\n * Enum representing the built-in System pipeline types.\n * These types can be extended to introduce more types, and the System Runtime Pipeline should\n * add Middleware to handle the newly added types.\n */\nexport enum SystemType {\n /**\n * The initialization phase of the Module pipeline.\n * This phase is typically used for setting up initial state and resources.\n */\n initialize = 'initialize',\n\n /**\n * The update phase of the Module pipeline.\n * This phase is responsible for updating the game logic and state of entities.\n */\n update = 'update',\n\n /**\n * The render phase of the Module pipeline.\n * This phase is used for rendering the game to the screen.\n */\n render = 'render',\n\n /**\n * The synchronization phase of the Module pipeline.\n * This phase is used for synchronizing game state with external systems or other components.\n */\n sync = 'sync'\n}\n"],"mappings":";AAKO,IAAK,aAAL,kBAAKA,gBAAL;AAKL,EAAAA,YAAA,gBAAa;AAMb,EAAAA,YAAA,YAAS;AAMT,EAAAA,YAAA,YAAS;AAMT,EAAAA,YAAA,UAAO;AAvBG,SAAAA;AAAA,GAAA;","names":["SystemType"]}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/systems/module/system-type.ts"],"sourcesContent":["/**\n * Enum representing the built-in System pipeline types.\n * These types can be extended to introduce more types, and the System Runtime Pipeline should\n * add Middleware to handle the newly added types.\n */\nexport enum SystemType {\n /**\n * The initialization phase of the Module pipeline.\n * This phase is typically used for setting up initial state and resources.\n */\n initialize = 'initialize',\n\n /**\n * The update phase of the Module pipeline.\n * This phase is responsible for updating the game logic and state of entities.\n */\n update = 'update',\n\n /**\n * The render phase of the Module pipeline.\n * This phase is used for rendering the game to the screen.\n */\n render = 'render',\n\n /**\n * The synchronization phase of the Module pipeline.\n * This phase is used for synchronizing game state with external systems or other components.\n */\n sync = 'sync'\n}\n"],"mappings":";;;;;;AAKA,IAAY,oDAAL;;;;;AAKL;;;;;AAMA;;;;;AAMA;;;;;AAMA;;AACD"}
@@ -1,30 +1,25 @@
1
+ //#region src/utils/types.d.ts
1
2
  /**
2
3
  * Creates a type that maps all properties of T to boolean.
3
4
  *
4
5
  * @template T - The type to map properties to boolean.
5
6
  * @returns A type with all properties of T mapped to boolean.
6
7
  */
7
- type BooleanProps<T> = {
8
- [Property in keyof T]: boolean;
9
- };
8
+ type BooleanProps<T> = { [Property in keyof T]: boolean };
10
9
  /**
11
10
  * Creates a type that makes all properties of T mutable.
12
11
  *
13
12
  * @template T - The type to make properties mutable.
14
13
  * @returns A type with all properties of T made mutable.
15
14
  */
16
- type Mutable<T> = {
17
- -readonly [K in keyof T]: T[K];
18
- };
15
+ type Mutable<T> = { -readonly [K in keyof T]: T[K] };
19
16
  /**
20
17
  * Creates a type that makes all properties of T mutable recursively.
21
18
  *
22
19
  * @template T - The type to make properties mutable recursively.
23
20
  * @returns A type with all properties of T made mutable recursively.
24
21
  */
25
- type MutableDeep<T> = {
26
- -readonly [K in keyof T]: Mutable<T[K]>;
27
- };
22
+ type MutableDeep<T> = { -readonly [K in keyof T]: Mutable<T[K]> };
28
23
  type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
29
24
  /**
30
25
  * Creates a type that makes all properties of T immutable.
@@ -61,17 +56,14 @@ type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
61
56
  * @template T - The type to make properties immutable.
62
57
  * @returns A type with all properties of T made immutable.
63
58
  */
64
- type ImmutableObject<T> = {
65
- readonly [K in keyof T]: T[K];
66
- };
59
+ type ImmutableObject<T> = { readonly [K in keyof T]: T[K] };
67
60
  /**
68
61
  * Creates a type that makes all properties of T immutable recursively.
69
62
  *
70
63
  * @template T - The type to make properties immutable recursively.
71
64
  * @returns A type with all properties of T made immutable recursively.
72
65
  */
73
- type ImmutableObjectDeep<T> = {
74
- readonly [K in keyof T]: Immutable<T[K]>;
75
- };
76
-
77
- export type { BooleanProps as B, Immutable as I, Mutable as M, MutableDeep as a, ImmutableArray as b, ImmutableMap as c, ImmutableSet as d, ImmutableObject as e, ImmutableObjectDeep as f };
66
+ type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
67
+ //#endregion
68
+ export { BooleanProps, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, Mutable, MutableDeep };
69
+ //# sourceMappingURL=types-DvzdpbLu.d.cts.map
@@ -1,30 +1,25 @@
1
+ //#region src/utils/types.d.ts
1
2
  /**
2
3
  * Creates a type that maps all properties of T to boolean.
3
4
  *
4
5
  * @template T - The type to map properties to boolean.
5
6
  * @returns A type with all properties of T mapped to boolean.
6
7
  */
7
- type BooleanProps<T> = {
8
- [Property in keyof T]: boolean;
9
- };
8
+ type BooleanProps<T> = { [Property in keyof T]: boolean };
10
9
  /**
11
10
  * Creates a type that makes all properties of T mutable.
12
11
  *
13
12
  * @template T - The type to make properties mutable.
14
13
  * @returns A type with all properties of T made mutable.
15
14
  */
16
- type Mutable<T> = {
17
- -readonly [K in keyof T]: T[K];
18
- };
15
+ type Mutable<T> = { -readonly [K in keyof T]: T[K] };
19
16
  /**
20
17
  * Creates a type that makes all properties of T mutable recursively.
21
18
  *
22
19
  * @template T - The type to make properties mutable recursively.
23
20
  * @returns A type with all properties of T made mutable recursively.
24
21
  */
25
- type MutableDeep<T> = {
26
- -readonly [K in keyof T]: Mutable<T[K]>;
27
- };
22
+ type MutableDeep<T> = { -readonly [K in keyof T]: Mutable<T[K]> };
28
23
  type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
29
24
  /**
30
25
  * Creates a type that makes all properties of T immutable.
@@ -61,17 +56,14 @@ type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
61
56
  * @template T - The type to make properties immutable.
62
57
  * @returns A type with all properties of T made immutable.
63
58
  */
64
- type ImmutableObject<T> = {
65
- readonly [K in keyof T]: T[K];
66
- };
59
+ type ImmutableObject<T> = { readonly [K in keyof T]: T[K] };
67
60
  /**
68
61
  * Creates a type that makes all properties of T immutable recursively.
69
62
  *
70
63
  * @template T - The type to make properties immutable recursively.
71
64
  * @returns A type with all properties of T made immutable recursively.
72
65
  */
73
- type ImmutableObjectDeep<T> = {
74
- readonly [K in keyof T]: Immutable<T[K]>;
75
- };
76
-
77
- export type { BooleanProps as B, Immutable as I, Mutable as M, MutableDeep as a, ImmutableArray as b, ImmutableMap as c, ImmutableSet as d, ImmutableObject as e, ImmutableObjectDeep as f };
66
+ type ImmutableObjectDeep<T> = { readonly [K in keyof T]: Immutable<T[K]> };
67
+ //#endregion
68
+ export { BooleanProps, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, Mutable, MutableDeep };
69
+ //# sourceMappingURL=types-yh4pOGEm.d.ts.map
@@ -1,38 +1,28 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
1
 
19
- // src/utils/index.ts
20
- var utils_exports = {};
21
- __export(utils_exports, {
22
- LogLevel: () => LogLevel
23
- });
24
- module.exports = __toCommonJS(utils_exports);
2
+ //#region src/utils/logger.ts
3
+ /**
4
+ * An enumeration of log levels.
5
+ */
6
+ let LogLevel = /* @__PURE__ */ function(LogLevel$1) {
7
+ /**
8
+ * Trace-level logging.
9
+ */
10
+ LogLevel$1[LogLevel$1["trace"] = 0] = "trace";
11
+ /**
12
+ * Debug-level logging.
13
+ */
14
+ LogLevel$1[LogLevel$1["debug"] = 1] = "debug";
15
+ /**
16
+ * Warning-level logging.
17
+ */
18
+ LogLevel$1[LogLevel$1["warn"] = 2] = "warn";
19
+ /**
20
+ * Error-level logging.
21
+ */
22
+ LogLevel$1[LogLevel$1["error"] = 3] = "error";
23
+ return LogLevel$1;
24
+ }({});
25
25
 
26
- // src/utils/logger.ts
27
- var LogLevel = /* @__PURE__ */ ((LogLevel2) => {
28
- LogLevel2[LogLevel2["trace"] = 0] = "trace";
29
- LogLevel2[LogLevel2["debug"] = 1] = "debug";
30
- LogLevel2[LogLevel2["warn"] = 2] = "warn";
31
- LogLevel2[LogLevel2["error"] = 3] = "error";
32
- return LogLevel2;
33
- })(LogLevel || {});
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- LogLevel
37
- });
26
+ //#endregion
27
+ exports.LogLevel = LogLevel;
38
28
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts","../../src/utils/logger.ts"],"sourcesContent":["export * from './json-serializer';\nexport * from './logger';\nexport * from './performance-timer';\nexport * from './types';\n","/**\n * An ILogger instance allows printing messages to console or other targets.\n */\nexport interface ILogger {\n /**\n * Logs a message with a specified level.\n * @param level The level of the message.\n * @param message The message to be logged.\n * @param ...args Additional arguments to be included in the message.\n */\n log(level: LogLevel, message: any, ...args: any[]): void;\n\n /**\n * Logs a trace-level message.\n * @param message The message to be logged.\n * @param ...args Additional arguments to be included in the message.\n */\n trace(message: any, ...args: any[]): void;\n\n /**\n * Logs a debug-level message.\n * @param message The message to be logged.\n * @param ...args Additional arguments to be included in the message.\n */\n debug(message: any, ...args: any[]): void;\n\n /**\n * Logs a warning-level message.\n * @param message The message to be logged.\n * @param ...args Additional arguments to be included in the message.\n */\n warn(message: any, ...args: any[]): void;\n\n /**\n * Logs an error-level message.\n * @param message The message to be logged.\n * @param ...args Additional arguments to be included in the message.\n */\n error(message: any, ...args: any[]): void;\n}\n\n/**\n * An enumeration of log levels.\n */\nexport enum LogLevel {\n /**\n * Trace-level logging.\n */\n trace,\n\n /**\n * Debug-level logging.\n */\n debug,\n\n /**\n * Warning-level logging.\n */\n warn,\n\n /**\n * Error-level logging.\n */\n error\n}\n\n/**\n * Options for configuring an ILogger instance.\n */\nexport interface ILoggerOptions {\n /**\n * A map of log levels to their corresponding enabled status.\n */\n enabled: Map<LogLevel, boolean>;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC4CO,IAAK,WAAL,kBAAKA,cAAL;AAIL,EAAAA,oBAAA;AAKA,EAAAA,oBAAA;AAKA,EAAAA,oBAAA;AAKA,EAAAA,oBAAA;AAnBU,SAAAA;AAAA,GAAA;","names":["LogLevel"]}
1
+ {"version":3,"file":"index.cjs","names":[],"sources":["../../src/utils/logger.ts"],"sourcesContent":["/**\n * An ILogger instance allows printing messages to console or other targets.\n */\nexport interface ILogger {\n /**\n * Logs a message with a specified level.\n * @param level The level of the message.\n * @param message The message to be logged.\n * @param ...args Additional arguments to be included in the message.\n */\n log(level: LogLevel, message: any, ...args: any[]): void;\n\n /**\n * Logs a trace-level message.\n * @param message The message to be logged.\n * @param ...args Additional arguments to be included in the message.\n */\n trace(message: any, ...args: any[]): void;\n\n /**\n * Logs a debug-level message.\n * @param message The message to be logged.\n * @param ...args Additional arguments to be included in the message.\n */\n debug(message: any, ...args: any[]): void;\n\n /**\n * Logs a warning-level message.\n * @param message The message to be logged.\n * @param ...args Additional arguments to be included in the message.\n */\n warn(message: any, ...args: any[]): void;\n\n /**\n * Logs an error-level message.\n * @param message The message to be logged.\n * @param ...args Additional arguments to be included in the message.\n */\n error(message: any, ...args: any[]): void;\n}\n\n/**\n * An enumeration of log levels.\n */\nexport enum LogLevel {\n /**\n * Trace-level logging.\n */\n trace,\n\n /**\n * Debug-level logging.\n */\n debug,\n\n /**\n * Warning-level logging.\n */\n warn,\n\n /**\n * Error-level logging.\n */\n error\n}\n\n/**\n * Options for configuring an ILogger instance.\n */\nexport interface ILoggerOptions {\n /**\n * A map of log levels to their corresponding enabled status.\n */\n enabled: Map<LogLevel, boolean>;\n}\n"],"mappings":";;;;;AA4CA,IAAY,gDAAL;;;;AAIL;;;;AAKA;;;;AAKA;;;;AAKA;;AACD"}