@awesome-ecs/abstract 0.30.0 → 0.31.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/factories/index.cjs.map +1 -1
- package/dist/factories/index.d.cts +2 -2
- package/dist/factories/index.d.mts +2 -2
- package/dist/factories/index.mjs.map +1 -1
- package/dist/{index-8XDo0pla.d.mts → index-DZlhICMZ.d.mts} +136 -64
- package/dist/{index-BVkmidEx.d.cts → index-zohK7ftH.d.cts} +136 -64
- package/dist/pipelines/index.d.cts +1 -1
- package/dist/pipelines/index.d.mts +1 -1
- package/dist/systems/index.cjs +11 -0
- package/dist/systems/index.cjs.map +1 -1
- package/dist/systems/index.d.cts +2 -2
- package/dist/systems/index.d.mts +2 -2
- package/dist/systems/index.mjs +11 -1
- package/dist/systems/index.mjs.map +1 -1
- package/dist/utils/index.d.cts +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import { IPipelineContext } from '../pipelines';\r\nimport { IPipeline } from '../pipelines/pipeline';\r\n\r\n/**\r\n * Category identifier for grouping performance metrics.\r\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\r\n */\r\nexport type PipelineCategoryName = string;\r\n\r\n/**\r\n * Built-in metric categories for classifying pipeline and middleware performance entries.\r\n *\r\n * - `module` — System module pipelines (initialize, update, render, sync phases).\r\n * - `runtime` — Runtime orchestration pipeline and its middleware.\r\n * - `system` — Individual system middleware within a module pipeline.\r\n */\r\nexport enum PipelineCategory {\r\n module = 'module',\r\n runtime = 'runtime',\r\n system = 'system'\r\n}\r\n\r\n/**\r\n * Options for identifying and categorizing performance metrics on pipelines.\r\n */\r\nexport type
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import { IPipelineContext } from '../pipelines';\r\nimport { IPipeline } from '../pipelines/pipeline';\r\n\r\n/**\r\n * Category identifier for grouping performance metrics.\r\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\r\n */\r\nexport type PipelineCategoryName = string;\r\n\r\n/**\r\n * Built-in metric categories for classifying pipeline and middleware performance entries.\r\n *\r\n * - `module` — System module pipelines (initialize, update, render, sync phases).\r\n * - `runtime` — Runtime orchestration pipeline and its middleware.\r\n * - `system` — Individual system middleware within a module pipeline.\r\n */\r\nexport enum PipelineCategory {\r\n module = 'module',\r\n runtime = 'runtime',\r\n system = 'system'\r\n}\r\n\r\n/**\r\n * Options for identifying and categorizing performance metrics on pipelines.\r\n */\r\nexport type PipelineOptions = {\r\n /** Display name for the pipeline in performance metrics. */\r\n pipelineName: string;\r\n /** Category assigned to pipeline-level metric entries. */\r\n pipelineCategory: PipelineCategoryName;\r\n /** Category assigned to per-middleware metric entries within this pipeline. */\r\n middlewareCategory: PipelineCategoryName;\r\n};\r\n\r\n/**\r\n * Creates pipeline instances for various contexts.\r\n * Abstracts pipeline creation to support different implementations.\r\n * Used by the system to instantiate pipelines without coupling to specific implementations.\r\n */\r\nexport interface IPipelineFactory {\r\n /**\r\n * Creates a new pipeline for the specified context type.\r\n * @template TContext - The context type for the pipeline. Must extend IPipelineContext.\r\n * @param options - Optional performance metric options (name, category) for the pipeline.\r\n * @returns A new pipeline instance ready for middleware registration.\r\n */\r\n createPipeline<TContext extends IPipelineContext>(options?: PipelineOptions): IPipeline<TContext>;\r\n}\r\n"],"mappings":";;;;;;;;;AAgBA,IAAY,mBAAL,yBAAA,kBAAA;AACL,kBAAA,YAAA;AACA,kBAAA,aAAA;AACA,kBAAA,YAAA;;KACD"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { d as IPipelineFactory, f as PipelineCategory, h as IContextFactory, m as
|
|
2
|
-
export { IContextFactory, IPipelineFactory, IRuntimeFactory, ISystemsFactory, PipelineCategory, PipelineCategoryName,
|
|
1
|
+
import { d as IPipelineFactory, f as PipelineCategory, h as IContextFactory, m as PipelineOptions, n as IRuntimeFactory, p as PipelineCategoryName, t as ISystemsFactory } from "../index-zohK7ftH.cjs";
|
|
2
|
+
export { IContextFactory, IPipelineFactory, IRuntimeFactory, ISystemsFactory, PipelineCategory, PipelineCategoryName, PipelineOptions };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { d as IPipelineFactory, f as PipelineCategory, h as IContextFactory, m as
|
|
2
|
-
export { IContextFactory, IPipelineFactory, IRuntimeFactory, ISystemsFactory, PipelineCategory, PipelineCategoryName,
|
|
1
|
+
import { d as IPipelineFactory, f as PipelineCategory, h as IContextFactory, m as PipelineOptions, n as IRuntimeFactory, p as PipelineCategoryName, t as ISystemsFactory } from "../index-DZlhICMZ.mjs";
|
|
2
|
+
export { IContextFactory, IPipelineFactory, IRuntimeFactory, ISystemsFactory, PipelineCategory, PipelineCategoryName, PipelineOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import { IPipelineContext } from '../pipelines';\r\nimport { IPipeline } from '../pipelines/pipeline';\r\n\r\n/**\r\n * Category identifier for grouping performance metrics.\r\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\r\n */\r\nexport type PipelineCategoryName = string;\r\n\r\n/**\r\n * Built-in metric categories for classifying pipeline and middleware performance entries.\r\n *\r\n * - `module` — System module pipelines (initialize, update, render, sync phases).\r\n * - `runtime` — Runtime orchestration pipeline and its middleware.\r\n * - `system` — Individual system middleware within a module pipeline.\r\n */\r\nexport enum PipelineCategory {\r\n module = 'module',\r\n runtime = 'runtime',\r\n system = 'system'\r\n}\r\n\r\n/**\r\n * Options for identifying and categorizing performance metrics on pipelines.\r\n */\r\nexport type
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/factories/pipeline-factory.ts"],"sourcesContent":["import { IPipelineContext } from '../pipelines';\r\nimport { IPipeline } from '../pipelines/pipeline';\r\n\r\n/**\r\n * Category identifier for grouping performance metrics.\r\n * Typed as string to allow extension beyond the built-in {@link PipelineCategory} values.\r\n */\r\nexport type PipelineCategoryName = string;\r\n\r\n/**\r\n * Built-in metric categories for classifying pipeline and middleware performance entries.\r\n *\r\n * - `module` — System module pipelines (initialize, update, render, sync phases).\r\n * - `runtime` — Runtime orchestration pipeline and its middleware.\r\n * - `system` — Individual system middleware within a module pipeline.\r\n */\r\nexport enum PipelineCategory {\r\n module = 'module',\r\n runtime = 'runtime',\r\n system = 'system'\r\n}\r\n\r\n/**\r\n * Options for identifying and categorizing performance metrics on pipelines.\r\n */\r\nexport type PipelineOptions = {\r\n /** Display name for the pipeline in performance metrics. */\r\n pipelineName: string;\r\n /** Category assigned to pipeline-level metric entries. */\r\n pipelineCategory: PipelineCategoryName;\r\n /** Category assigned to per-middleware metric entries within this pipeline. */\r\n middlewareCategory: PipelineCategoryName;\r\n};\r\n\r\n/**\r\n * Creates pipeline instances for various contexts.\r\n * Abstracts pipeline creation to support different implementations.\r\n * Used by the system to instantiate pipelines without coupling to specific implementations.\r\n */\r\nexport interface IPipelineFactory {\r\n /**\r\n * Creates a new pipeline for the specified context type.\r\n * @template TContext - The context type for the pipeline. Must extend IPipelineContext.\r\n * @param options - Optional performance metric options (name, category) for the pipeline.\r\n * @returns A new pipeline instance ready for middleware registration.\r\n */\r\n createPipeline<TContext extends IPipelineContext>(options?: PipelineOptions): IPipeline<TContext>;\r\n}\r\n"],"mappings":";;;;;;;;AAgBA,IAAY,mBAAL,yBAAA,kBAAA;AACL,kBAAA,YAAA;AACA,kBAAA,aAAA;AACA,kBAAA,YAAA;;KACD"}
|
|
@@ -430,6 +430,87 @@ interface IPipelineRunner<TContext extends IPipelineContext> {
|
|
|
430
430
|
cleanup(context: Partial<TContext>, middleware: IMiddleware<TContext>[]): void | Promise<void>;
|
|
431
431
|
}
|
|
432
432
|
//#endregion
|
|
433
|
+
//#region src/systems/pipeline/system-middleware.d.ts
|
|
434
|
+
type SystemMiddlewareName = string;
|
|
435
|
+
type SystemModuleName = string;
|
|
436
|
+
type MiddlewareRegistry = Map<SystemMiddlewareName, SystemModuleName>;
|
|
437
|
+
type MiddlewareRegistryReadonly = ReadonlyMap<SystemMiddlewareName, SystemModuleName>;
|
|
438
|
+
/**
|
|
439
|
+
* A middleware unit that operates within the system pipeline.
|
|
440
|
+
* System middleware receive comprehensive context about the entity being processed
|
|
441
|
+
* and can influence entity state and behavior through various APIs.
|
|
442
|
+
*
|
|
443
|
+
* @template TEntity - The entity type this middleware handles.
|
|
444
|
+
*/
|
|
445
|
+
type ISystemMiddleware<TEntity extends IEntity> = IMiddleware<ISystemContext<TEntity>>;
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region src/systems/pipeline/system-context-control.d.ts
|
|
448
|
+
declare enum SystemContextControlState {
|
|
449
|
+
none = "none",
|
|
450
|
+
enableCurrentSystem = "enableCurrentSystem",
|
|
451
|
+
disableCurrentSystem = "disableCurrentSystem",
|
|
452
|
+
enableCurrentModule = "enableCurrentModule",
|
|
453
|
+
disableCurrentModule = "disableCurrentModule"
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Interface for controlling the execution of systems and modules within a system context.
|
|
457
|
+
* This allows middleware to enable or disable specific systems or entire modules for the current entity.
|
|
458
|
+
*/
|
|
459
|
+
interface ISystemContextControl {
|
|
460
|
+
/**
|
|
461
|
+
* Disables the current system for the current entity.
|
|
462
|
+
*/
|
|
463
|
+
disableCurrentSystem(): void;
|
|
464
|
+
/**
|
|
465
|
+
* Re-enables the current system for the current entity.
|
|
466
|
+
*/
|
|
467
|
+
enableCurrentSystem(): void;
|
|
468
|
+
/**
|
|
469
|
+
* Disables the current module for the current entity.
|
|
470
|
+
*/
|
|
471
|
+
disableCurrentModule(): void;
|
|
472
|
+
/**
|
|
473
|
+
* Re-enables the current module for the current entity.
|
|
474
|
+
*/
|
|
475
|
+
enableCurrentModule(): void;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Extended system context interface that includes control state for middleware to manage system and module execution.
|
|
479
|
+
* This allows middleware to query and modify the execution state of systems and modules during pipeline processing.
|
|
480
|
+
*/
|
|
481
|
+
interface ISystemContextControlState extends ISystemContextControl {
|
|
482
|
+
/**
|
|
483
|
+
* Current state of system/module execution control, indicating whether the current system or module is enabled or disabled.
|
|
484
|
+
*/
|
|
485
|
+
readonly state: SystemContextControlState;
|
|
486
|
+
/**
|
|
487
|
+
* Checks if a specific middleware is currently disabled in the context, allowing middleware to conditionally execute logic based on the enabled/disabled state of other middleware.
|
|
488
|
+
* @param middleware - The middleware to check for disabled state.
|
|
489
|
+
* @returns True if the specified middleware is currently disabled, false otherwise.
|
|
490
|
+
*/
|
|
491
|
+
isMiddlewareDisabled(middleware: ISystemMiddleware<IEntity>): boolean;
|
|
492
|
+
/**
|
|
493
|
+
* Disables a specific middleware in the context.
|
|
494
|
+
* @param middleware - The middleware to disable.
|
|
495
|
+
*/
|
|
496
|
+
disableMiddleware(middleware: ISystemMiddleware<IEntity>): void;
|
|
497
|
+
/**
|
|
498
|
+
* Enables a specific middleware in the context.
|
|
499
|
+
* @param middleware - The middleware to enable.
|
|
500
|
+
*/
|
|
501
|
+
enableMiddleware(middleware: ISystemMiddleware<IEntity>): void;
|
|
502
|
+
/**
|
|
503
|
+
* Disables an entire module of middleware in the context.
|
|
504
|
+
* @param middleware - A middleware from the module to disable.
|
|
505
|
+
*/
|
|
506
|
+
disableModule(middleware: ISystemMiddleware<IEntity>): void;
|
|
507
|
+
/**
|
|
508
|
+
* Enables an entire module of middleware in the context.
|
|
509
|
+
* @param middleware - A middleware from the module to enable.
|
|
510
|
+
*/
|
|
511
|
+
enableModule(middleware: ISystemMiddleware<IEntity>): void;
|
|
512
|
+
}
|
|
513
|
+
//#endregion
|
|
433
514
|
//#region src/systems/pipeline/system-context-events.d.ts
|
|
434
515
|
/**
|
|
435
516
|
* System context API for event-driven entity communication.
|
|
@@ -694,6 +775,10 @@ interface ISystemContext<TEntity extends IEntity> extends IPipelineContext {
|
|
|
694
775
|
* Event system API for publishing and subscribing to entity events.
|
|
695
776
|
*/
|
|
696
777
|
readonly events: Immutable<ISystemContextEvents>;
|
|
778
|
+
/**
|
|
779
|
+
* Logging interface for debug and diagnostic output.
|
|
780
|
+
*/
|
|
781
|
+
readonly logger: Immutable<ILogger>;
|
|
697
782
|
/**
|
|
698
783
|
* Proxy management API for establishing and managing entity relationships.
|
|
699
784
|
*/
|
|
@@ -702,6 +787,10 @@ interface ISystemContext<TEntity extends IEntity> extends IPipelineContext {
|
|
|
702
787
|
* Repository access API for querying and modifying entity storage.
|
|
703
788
|
*/
|
|
704
789
|
readonly repository: Immutable<ISystemContextRepository>;
|
|
790
|
+
/**
|
|
791
|
+
* The per-entity runtime state and control interface for this system context.
|
|
792
|
+
*/
|
|
793
|
+
readonly runtime: PipelineRuntime;
|
|
705
794
|
/**
|
|
706
795
|
* Scheduling API for requesting follow-up entity updates.
|
|
707
796
|
*/
|
|
@@ -711,9 +800,9 @@ interface ISystemContext<TEntity extends IEntity> extends IPipelineContext {
|
|
|
711
800
|
*/
|
|
712
801
|
readonly snapshot: Immutable<ISystemContextSnapshot>;
|
|
713
802
|
/**
|
|
714
|
-
*
|
|
803
|
+
* Control API for enabling/disabling the current system or entire module during execution.
|
|
715
804
|
*/
|
|
716
|
-
readonly
|
|
805
|
+
readonly systems: Immutable<ISystemContextControl>;
|
|
717
806
|
}
|
|
718
807
|
//#endregion
|
|
719
808
|
//#region src/systems/pipeline/system-context-mutable.d.ts
|
|
@@ -745,9 +834,10 @@ interface IContextFactory {
|
|
|
745
834
|
* On subsequent calls, returns the cached context.
|
|
746
835
|
* @template TEntity - The entity type for which the system context is being created.
|
|
747
836
|
* @param entity - The entity to create or retrieve the context for.
|
|
837
|
+
* @param registry - Optional middleware registry to associate with the context for pipeline execution.
|
|
748
838
|
* @returns The mutable system context for the entity.
|
|
749
839
|
*/
|
|
750
|
-
getOrCreateContext<TEntity extends IEntity>(entity: Immutable<TEntity
|
|
840
|
+
getOrCreateContext<TEntity extends IEntity>(entity: Immutable<TEntity>, registry?: MiddlewareRegistryReadonly): IMutableSystemContext<TEntity>;
|
|
751
841
|
/**
|
|
752
842
|
* Retrieves a previously cached system context by entity UID.
|
|
753
843
|
* @template TEntity - The entity type.
|
|
@@ -784,7 +874,7 @@ declare enum PipelineCategory {
|
|
|
784
874
|
/**
|
|
785
875
|
* Options for identifying and categorizing performance metrics on pipelines.
|
|
786
876
|
*/
|
|
787
|
-
type
|
|
877
|
+
type PipelineOptions = {
|
|
788
878
|
/** Display name for the pipeline in performance metrics. */pipelineName: string; /** Category assigned to pipeline-level metric entries. */
|
|
789
879
|
pipelineCategory: PipelineCategoryName; /** Category assigned to per-middleware metric entries within this pipeline. */
|
|
790
880
|
middlewareCategory: PipelineCategoryName;
|
|
@@ -801,7 +891,7 @@ interface IPipelineFactory {
|
|
|
801
891
|
* @param options - Optional performance metric options (name, category) for the pipeline.
|
|
802
892
|
* @returns A new pipeline instance ready for middleware registration.
|
|
803
893
|
*/
|
|
804
|
-
createPipeline<TContext extends IPipelineContext>(options?:
|
|
894
|
+
createPipeline<TContext extends IPipelineContext>(options?: PipelineOptions): IPipeline<TContext>;
|
|
805
895
|
}
|
|
806
896
|
//#endregion
|
|
807
897
|
//#region src/systems/system-type.d.ts
|
|
@@ -833,52 +923,29 @@ declare enum SystemType {
|
|
|
833
923
|
sync = 3
|
|
834
924
|
}
|
|
835
925
|
//#endregion
|
|
836
|
-
//#region src/systems/module/systems-module.d.ts
|
|
837
|
-
|
|
838
|
-
* Collection of pipelines for a specific entity type.
|
|
839
|
-
* Defines the complete system processing flow for one entity category.
|
|
840
|
-
*
|
|
841
|
-
* @template TEntity - The entity type this module processes.
|
|
842
|
-
*/
|
|
843
|
-
interface ISystemsModule<TEntity extends IEntity> {
|
|
926
|
+
//#region src/systems/module/systems-module-builder.d.ts
|
|
927
|
+
interface ISystemsModuleBuilderReadonly<TEntity extends IEntity> {
|
|
844
928
|
/**
|
|
845
|
-
* The
|
|
846
|
-
* Each pipeline contains middleware that operates on the entity.
|
|
929
|
+
* The Module's name.
|
|
847
930
|
*/
|
|
848
|
-
readonly
|
|
931
|
+
readonly name: string;
|
|
849
932
|
/**
|
|
850
|
-
*
|
|
851
|
-
* If provided, is called when a new entity of this type is created.
|
|
852
|
-
* @param model - The initialization model.
|
|
853
|
-
* @returns The initialized entity.
|
|
933
|
+
* Read-only map of system pipelines keyed by SystemType.
|
|
854
934
|
*/
|
|
855
|
-
readonly
|
|
935
|
+
readonly pipelines: ReadonlyMap<SystemType, IPipeline<ISystemContext<TEntity>>>;
|
|
856
936
|
/**
|
|
857
|
-
*
|
|
858
|
-
* A new scope ID is auto-generated. All child entities inherit this scope.
|
|
859
|
-
* Typically used for root entities like Engine.
|
|
937
|
+
* Read-only registry mapping middleware names to their originating module names.
|
|
860
938
|
*/
|
|
861
|
-
readonly
|
|
939
|
+
readonly middlewareRegistry: MiddlewareRegistryReadonly;
|
|
862
940
|
/**
|
|
863
|
-
*
|
|
864
|
-
* It joins the inherited scope and becomes resolvable via `context.proxies.get()`
|
|
865
|
-
* by any entity in the same scope. Throws if no scope exists.
|
|
866
|
-
* Typically used for scope-wide entities like Scene, Input, AssetsManager.
|
|
941
|
+
* Whether this entity type is a scope root. When initialized, a new scope is auto-generated and all child entities inherit it.
|
|
867
942
|
*/
|
|
868
|
-
readonly
|
|
943
|
+
readonly scopeRoot: boolean;
|
|
944
|
+
/**
|
|
945
|
+
* Whether this entity type is a scoped proxy. When initialized, the entity registers itself in the inherited scope, making it resolvable via `context.proxies.get()` by any entity in the same scope.
|
|
946
|
+
*/
|
|
947
|
+
readonly scopedProxy: boolean;
|
|
869
948
|
}
|
|
870
|
-
//#endregion
|
|
871
|
-
//#region src/systems/pipeline/system-middleware.d.ts
|
|
872
|
-
/**
|
|
873
|
-
* A middleware unit that operates within the system pipeline.
|
|
874
|
-
* System middleware receive comprehensive context about the entity being processed
|
|
875
|
-
* and can influence entity state and behavior through various APIs.
|
|
876
|
-
*
|
|
877
|
-
* @template TEntity - The entity type this middleware handles.
|
|
878
|
-
*/
|
|
879
|
-
type ISystemMiddleware<TEntity extends IEntity> = IMiddleware<ISystemContext<TEntity>>;
|
|
880
|
-
//#endregion
|
|
881
|
-
//#region src/systems/module/systems-module-builder.d.ts
|
|
882
949
|
/**
|
|
883
950
|
* Builder pattern interface for constructing system modules.
|
|
884
951
|
* Allows incremental registration of systems and modules for an entity type.
|
|
@@ -886,24 +953,8 @@ type ISystemMiddleware<TEntity extends IEntity> = IMiddleware<ISystemContext<TEn
|
|
|
886
953
|
*
|
|
887
954
|
* @template TEntity - The entity type for which systems are being added.
|
|
888
955
|
*/
|
|
889
|
-
interface ISystemsModuleBuilder<TEntity extends IEntity> {
|
|
890
|
-
|
|
891
|
-
* The Module Builder's name.
|
|
892
|
-
*/
|
|
893
|
-
readonly name: string;
|
|
894
|
-
/**
|
|
895
|
-
* The pipelines being built.
|
|
896
|
-
* Accessible during and after construction.
|
|
897
|
-
*/
|
|
898
|
-
readonly pipelines: ReadonlyMap<SystemType, IPipeline<ISystemContext<TEntity>>>;
|
|
899
|
-
/**
|
|
900
|
-
* Whether this entity type is a scope root.
|
|
901
|
-
*/
|
|
902
|
-
readonly scopeRoot: boolean;
|
|
903
|
-
/**
|
|
904
|
-
* Whether this entity type is a scoped proxy.
|
|
905
|
-
*/
|
|
906
|
-
readonly scopedProxy: boolean;
|
|
956
|
+
interface ISystemsModuleBuilder<TEntity extends IEntity> extends ISystemsModuleBuilderReadonly<TEntity> {
|
|
957
|
+
readonly middlewareRegistry: MiddlewareRegistry;
|
|
907
958
|
/**
|
|
908
959
|
* Registers middleware systems for a specific pipeline stage.
|
|
909
960
|
* The middleware are added to the pipeline in the order provided.
|
|
@@ -936,6 +987,27 @@ interface ISystemsModuleBuilder<TEntity extends IEntity> {
|
|
|
936
987
|
setScopedProxy(): this;
|
|
937
988
|
}
|
|
938
989
|
//#endregion
|
|
990
|
+
//#region src/systems/module/systems-module.d.ts
|
|
991
|
+
/**
|
|
992
|
+
* Collection of pipelines for a specific entity type.
|
|
993
|
+
* Defines the complete system processing flow for one entity category.
|
|
994
|
+
*
|
|
995
|
+
* @template TEntity - The entity type this module processes.
|
|
996
|
+
*/
|
|
997
|
+
interface ISystemsModule<TEntity extends IEntity> {
|
|
998
|
+
/**
|
|
999
|
+
* The builder instance used to construct this module.
|
|
1000
|
+
*/
|
|
1001
|
+
readonly builder: ISystemsModuleBuilderReadonly<TEntity>;
|
|
1002
|
+
/**
|
|
1003
|
+
* Optional factory function to initialize new entity instances.
|
|
1004
|
+
* If provided, is called when a new entity of this type is created.
|
|
1005
|
+
* @param model - The initialization model.
|
|
1006
|
+
* @returns The initialized entity.
|
|
1007
|
+
*/
|
|
1008
|
+
readonly initEntity?: (model: IEntityModel) => TEntity;
|
|
1009
|
+
}
|
|
1010
|
+
//#endregion
|
|
939
1011
|
//#region src/systems/module/systems-module-repository.d.ts
|
|
940
1012
|
/**
|
|
941
1013
|
* Central registry for all systems modules in the ECS.
|
|
@@ -980,9 +1052,9 @@ interface ISystemsRuntime {
|
|
|
980
1052
|
* Processes a single entity update through its system pipeline.
|
|
981
1053
|
* If no update is provided, may dequeue one from an internal queue.
|
|
982
1054
|
* @param update - Optional specific update to process. If omitted, dequeues the next update.
|
|
983
|
-
* @returns
|
|
1055
|
+
* @returns Pipeline results containing execution data and metrics.
|
|
984
1056
|
*/
|
|
985
|
-
runTick(update?: IEntityUpdate):
|
|
1057
|
+
runTick(update?: IEntityUpdate): PipelineRuntime | Promise<PipelineRuntime> | void;
|
|
986
1058
|
}
|
|
987
1059
|
//#endregion
|
|
988
1060
|
//#region src/systems/runtime/systems-runtime-context.d.ts
|
|
@@ -1061,5 +1133,5 @@ interface ISystemsFactory {
|
|
|
1061
1133
|
createSystemsModuleBuilder<TEntity extends IEntity>(name: string): ISystemsModuleBuilder<TEntity>;
|
|
1062
1134
|
}
|
|
1063
1135
|
//#endregion
|
|
1064
|
-
export {
|
|
1065
|
-
//# sourceMappingURL=index-
|
|
1136
|
+
export { dispatchSequential as $, SystemModuleName as A, PipelineRuntime as B, ISystemContextControl as C, MiddlewareRegistry as D, ISystemMiddleware as E, IParentMiddleware as F, MiddlewareMetricsSummary as G, PerformanceMetricOptions as H, IPipeline as I, TickSnapshot as J, RenderSnapshot as K, IMiddlewareRunner as L, INestedContext as M, INestedMiddleware as N, MiddlewareRegistryReadonly as O, IParentContext as P, IJsonSerializer as Q, IMiddleware as R, ISystemContextEvents as S, SystemContextControlState as T, PerformanceTimeEntry as U, IPerformanceTimer as V, PerformanceTimerUid as W, ILoggerOptions as X, ILogger as Y, LogLevel as Z, ISystemContext as _, ISystemsRuntime as a, ISystemContextRepository as b, ISystemsModuleBuilder as c, IPipelineFactory as d, PipelineCategory as f, IMutableSystemContext as g, IContextFactory as h, ISystemsRuntimeContext as i, IPipelineRunner as j, SystemMiddlewareName as k, ISystemsModuleBuilderReadonly as l, PipelineOptions as m, IRuntimeFactory as n, ISystemsModuleRepository as o, PipelineCategoryName as p, TickMetricEntry as q, ISystemsRuntimeMiddleware as r, ISystemsModule as s, ISystemsFactory as t, SystemType as u, ISystemContextSnapshot as v, ISystemContextControlState as w, ISystemContextProxies as x, ISystemContextScheduler as y, IPipelineContext as z };
|
|
1137
|
+
//# sourceMappingURL=index-DZlhICMZ.d.mts.map
|
|
@@ -430,6 +430,87 @@ interface IPipelineRunner<TContext extends IPipelineContext> {
|
|
|
430
430
|
cleanup(context: Partial<TContext>, middleware: IMiddleware<TContext>[]): void | Promise<void>;
|
|
431
431
|
}
|
|
432
432
|
//#endregion
|
|
433
|
+
//#region src/systems/pipeline/system-middleware.d.ts
|
|
434
|
+
type SystemMiddlewareName = string;
|
|
435
|
+
type SystemModuleName = string;
|
|
436
|
+
type MiddlewareRegistry = Map<SystemMiddlewareName, SystemModuleName>;
|
|
437
|
+
type MiddlewareRegistryReadonly = ReadonlyMap<SystemMiddlewareName, SystemModuleName>;
|
|
438
|
+
/**
|
|
439
|
+
* A middleware unit that operates within the system pipeline.
|
|
440
|
+
* System middleware receive comprehensive context about the entity being processed
|
|
441
|
+
* and can influence entity state and behavior through various APIs.
|
|
442
|
+
*
|
|
443
|
+
* @template TEntity - The entity type this middleware handles.
|
|
444
|
+
*/
|
|
445
|
+
type ISystemMiddleware<TEntity extends IEntity> = IMiddleware<ISystemContext<TEntity>>;
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region src/systems/pipeline/system-context-control.d.ts
|
|
448
|
+
declare enum SystemContextControlState {
|
|
449
|
+
none = "none",
|
|
450
|
+
enableCurrentSystem = "enableCurrentSystem",
|
|
451
|
+
disableCurrentSystem = "disableCurrentSystem",
|
|
452
|
+
enableCurrentModule = "enableCurrentModule",
|
|
453
|
+
disableCurrentModule = "disableCurrentModule"
|
|
454
|
+
}
|
|
455
|
+
/**
|
|
456
|
+
* Interface for controlling the execution of systems and modules within a system context.
|
|
457
|
+
* This allows middleware to enable or disable specific systems or entire modules for the current entity.
|
|
458
|
+
*/
|
|
459
|
+
interface ISystemContextControl {
|
|
460
|
+
/**
|
|
461
|
+
* Disables the current system for the current entity.
|
|
462
|
+
*/
|
|
463
|
+
disableCurrentSystem(): void;
|
|
464
|
+
/**
|
|
465
|
+
* Re-enables the current system for the current entity.
|
|
466
|
+
*/
|
|
467
|
+
enableCurrentSystem(): void;
|
|
468
|
+
/**
|
|
469
|
+
* Disables the current module for the current entity.
|
|
470
|
+
*/
|
|
471
|
+
disableCurrentModule(): void;
|
|
472
|
+
/**
|
|
473
|
+
* Re-enables the current module for the current entity.
|
|
474
|
+
*/
|
|
475
|
+
enableCurrentModule(): void;
|
|
476
|
+
}
|
|
477
|
+
/**
|
|
478
|
+
* Extended system context interface that includes control state for middleware to manage system and module execution.
|
|
479
|
+
* This allows middleware to query and modify the execution state of systems and modules during pipeline processing.
|
|
480
|
+
*/
|
|
481
|
+
interface ISystemContextControlState extends ISystemContextControl {
|
|
482
|
+
/**
|
|
483
|
+
* Current state of system/module execution control, indicating whether the current system or module is enabled or disabled.
|
|
484
|
+
*/
|
|
485
|
+
readonly state: SystemContextControlState;
|
|
486
|
+
/**
|
|
487
|
+
* Checks if a specific middleware is currently disabled in the context, allowing middleware to conditionally execute logic based on the enabled/disabled state of other middleware.
|
|
488
|
+
* @param middleware - The middleware to check for disabled state.
|
|
489
|
+
* @returns True if the specified middleware is currently disabled, false otherwise.
|
|
490
|
+
*/
|
|
491
|
+
isMiddlewareDisabled(middleware: ISystemMiddleware<IEntity>): boolean;
|
|
492
|
+
/**
|
|
493
|
+
* Disables a specific middleware in the context.
|
|
494
|
+
* @param middleware - The middleware to disable.
|
|
495
|
+
*/
|
|
496
|
+
disableMiddleware(middleware: ISystemMiddleware<IEntity>): void;
|
|
497
|
+
/**
|
|
498
|
+
* Enables a specific middleware in the context.
|
|
499
|
+
* @param middleware - The middleware to enable.
|
|
500
|
+
*/
|
|
501
|
+
enableMiddleware(middleware: ISystemMiddleware<IEntity>): void;
|
|
502
|
+
/**
|
|
503
|
+
* Disables an entire module of middleware in the context.
|
|
504
|
+
* @param middleware - A middleware from the module to disable.
|
|
505
|
+
*/
|
|
506
|
+
disableModule(middleware: ISystemMiddleware<IEntity>): void;
|
|
507
|
+
/**
|
|
508
|
+
* Enables an entire module of middleware in the context.
|
|
509
|
+
* @param middleware - A middleware from the module to enable.
|
|
510
|
+
*/
|
|
511
|
+
enableModule(middleware: ISystemMiddleware<IEntity>): void;
|
|
512
|
+
}
|
|
513
|
+
//#endregion
|
|
433
514
|
//#region src/systems/pipeline/system-context-events.d.ts
|
|
434
515
|
/**
|
|
435
516
|
* System context API for event-driven entity communication.
|
|
@@ -694,6 +775,10 @@ interface ISystemContext<TEntity extends IEntity> extends IPipelineContext {
|
|
|
694
775
|
* Event system API for publishing and subscribing to entity events.
|
|
695
776
|
*/
|
|
696
777
|
readonly events: Immutable<ISystemContextEvents>;
|
|
778
|
+
/**
|
|
779
|
+
* Logging interface for debug and diagnostic output.
|
|
780
|
+
*/
|
|
781
|
+
readonly logger: Immutable<ILogger>;
|
|
697
782
|
/**
|
|
698
783
|
* Proxy management API for establishing and managing entity relationships.
|
|
699
784
|
*/
|
|
@@ -702,6 +787,10 @@ interface ISystemContext<TEntity extends IEntity> extends IPipelineContext {
|
|
|
702
787
|
* Repository access API for querying and modifying entity storage.
|
|
703
788
|
*/
|
|
704
789
|
readonly repository: Immutable<ISystemContextRepository>;
|
|
790
|
+
/**
|
|
791
|
+
* The per-entity runtime state and control interface for this system context.
|
|
792
|
+
*/
|
|
793
|
+
readonly runtime: PipelineRuntime;
|
|
705
794
|
/**
|
|
706
795
|
* Scheduling API for requesting follow-up entity updates.
|
|
707
796
|
*/
|
|
@@ -711,9 +800,9 @@ interface ISystemContext<TEntity extends IEntity> extends IPipelineContext {
|
|
|
711
800
|
*/
|
|
712
801
|
readonly snapshot: Immutable<ISystemContextSnapshot>;
|
|
713
802
|
/**
|
|
714
|
-
*
|
|
803
|
+
* Control API for enabling/disabling the current system or entire module during execution.
|
|
715
804
|
*/
|
|
716
|
-
readonly
|
|
805
|
+
readonly systems: Immutable<ISystemContextControl>;
|
|
717
806
|
}
|
|
718
807
|
//#endregion
|
|
719
808
|
//#region src/systems/pipeline/system-context-mutable.d.ts
|
|
@@ -745,9 +834,10 @@ interface IContextFactory {
|
|
|
745
834
|
* On subsequent calls, returns the cached context.
|
|
746
835
|
* @template TEntity - The entity type for which the system context is being created.
|
|
747
836
|
* @param entity - The entity to create or retrieve the context for.
|
|
837
|
+
* @param registry - Optional middleware registry to associate with the context for pipeline execution.
|
|
748
838
|
* @returns The mutable system context for the entity.
|
|
749
839
|
*/
|
|
750
|
-
getOrCreateContext<TEntity extends IEntity>(entity: Immutable<TEntity
|
|
840
|
+
getOrCreateContext<TEntity extends IEntity>(entity: Immutable<TEntity>, registry?: MiddlewareRegistryReadonly): IMutableSystemContext<TEntity>;
|
|
751
841
|
/**
|
|
752
842
|
* Retrieves a previously cached system context by entity UID.
|
|
753
843
|
* @template TEntity - The entity type.
|
|
@@ -784,7 +874,7 @@ declare enum PipelineCategory {
|
|
|
784
874
|
/**
|
|
785
875
|
* Options for identifying and categorizing performance metrics on pipelines.
|
|
786
876
|
*/
|
|
787
|
-
type
|
|
877
|
+
type PipelineOptions = {
|
|
788
878
|
/** Display name for the pipeline in performance metrics. */pipelineName: string; /** Category assigned to pipeline-level metric entries. */
|
|
789
879
|
pipelineCategory: PipelineCategoryName; /** Category assigned to per-middleware metric entries within this pipeline. */
|
|
790
880
|
middlewareCategory: PipelineCategoryName;
|
|
@@ -801,7 +891,7 @@ interface IPipelineFactory {
|
|
|
801
891
|
* @param options - Optional performance metric options (name, category) for the pipeline.
|
|
802
892
|
* @returns A new pipeline instance ready for middleware registration.
|
|
803
893
|
*/
|
|
804
|
-
createPipeline<TContext extends IPipelineContext>(options?:
|
|
894
|
+
createPipeline<TContext extends IPipelineContext>(options?: PipelineOptions): IPipeline<TContext>;
|
|
805
895
|
}
|
|
806
896
|
//#endregion
|
|
807
897
|
//#region src/systems/system-type.d.ts
|
|
@@ -833,52 +923,29 @@ declare enum SystemType {
|
|
|
833
923
|
sync = 3
|
|
834
924
|
}
|
|
835
925
|
//#endregion
|
|
836
|
-
//#region src/systems/module/systems-module.d.ts
|
|
837
|
-
|
|
838
|
-
* Collection of pipelines for a specific entity type.
|
|
839
|
-
* Defines the complete system processing flow for one entity category.
|
|
840
|
-
*
|
|
841
|
-
* @template TEntity - The entity type this module processes.
|
|
842
|
-
*/
|
|
843
|
-
interface ISystemsModule<TEntity extends IEntity> {
|
|
926
|
+
//#region src/systems/module/systems-module-builder.d.ts
|
|
927
|
+
interface ISystemsModuleBuilderReadonly<TEntity extends IEntity> {
|
|
844
928
|
/**
|
|
845
|
-
* The
|
|
846
|
-
* Each pipeline contains middleware that operates on the entity.
|
|
929
|
+
* The Module's name.
|
|
847
930
|
*/
|
|
848
|
-
readonly
|
|
931
|
+
readonly name: string;
|
|
849
932
|
/**
|
|
850
|
-
*
|
|
851
|
-
* If provided, is called when a new entity of this type is created.
|
|
852
|
-
* @param model - The initialization model.
|
|
853
|
-
* @returns The initialized entity.
|
|
933
|
+
* Read-only map of system pipelines keyed by SystemType.
|
|
854
934
|
*/
|
|
855
|
-
readonly
|
|
935
|
+
readonly pipelines: ReadonlyMap<SystemType, IPipeline<ISystemContext<TEntity>>>;
|
|
856
936
|
/**
|
|
857
|
-
*
|
|
858
|
-
* A new scope ID is auto-generated. All child entities inherit this scope.
|
|
859
|
-
* Typically used for root entities like Engine.
|
|
937
|
+
* Read-only registry mapping middleware names to their originating module names.
|
|
860
938
|
*/
|
|
861
|
-
readonly
|
|
939
|
+
readonly middlewareRegistry: MiddlewareRegistryReadonly;
|
|
862
940
|
/**
|
|
863
|
-
*
|
|
864
|
-
* It joins the inherited scope and becomes resolvable via `context.proxies.get()`
|
|
865
|
-
* by any entity in the same scope. Throws if no scope exists.
|
|
866
|
-
* Typically used for scope-wide entities like Scene, Input, AssetsManager.
|
|
941
|
+
* Whether this entity type is a scope root. When initialized, a new scope is auto-generated and all child entities inherit it.
|
|
867
942
|
*/
|
|
868
|
-
readonly
|
|
943
|
+
readonly scopeRoot: boolean;
|
|
944
|
+
/**
|
|
945
|
+
* Whether this entity type is a scoped proxy. When initialized, the entity registers itself in the inherited scope, making it resolvable via `context.proxies.get()` by any entity in the same scope.
|
|
946
|
+
*/
|
|
947
|
+
readonly scopedProxy: boolean;
|
|
869
948
|
}
|
|
870
|
-
//#endregion
|
|
871
|
-
//#region src/systems/pipeline/system-middleware.d.ts
|
|
872
|
-
/**
|
|
873
|
-
* A middleware unit that operates within the system pipeline.
|
|
874
|
-
* System middleware receive comprehensive context about the entity being processed
|
|
875
|
-
* and can influence entity state and behavior through various APIs.
|
|
876
|
-
*
|
|
877
|
-
* @template TEntity - The entity type this middleware handles.
|
|
878
|
-
*/
|
|
879
|
-
type ISystemMiddleware<TEntity extends IEntity> = IMiddleware<ISystemContext<TEntity>>;
|
|
880
|
-
//#endregion
|
|
881
|
-
//#region src/systems/module/systems-module-builder.d.ts
|
|
882
949
|
/**
|
|
883
950
|
* Builder pattern interface for constructing system modules.
|
|
884
951
|
* Allows incremental registration of systems and modules for an entity type.
|
|
@@ -886,24 +953,8 @@ type ISystemMiddleware<TEntity extends IEntity> = IMiddleware<ISystemContext<TEn
|
|
|
886
953
|
*
|
|
887
954
|
* @template TEntity - The entity type for which systems are being added.
|
|
888
955
|
*/
|
|
889
|
-
interface ISystemsModuleBuilder<TEntity extends IEntity> {
|
|
890
|
-
|
|
891
|
-
* The Module Builder's name.
|
|
892
|
-
*/
|
|
893
|
-
readonly name: string;
|
|
894
|
-
/**
|
|
895
|
-
* The pipelines being built.
|
|
896
|
-
* Accessible during and after construction.
|
|
897
|
-
*/
|
|
898
|
-
readonly pipelines: ReadonlyMap<SystemType, IPipeline<ISystemContext<TEntity>>>;
|
|
899
|
-
/**
|
|
900
|
-
* Whether this entity type is a scope root.
|
|
901
|
-
*/
|
|
902
|
-
readonly scopeRoot: boolean;
|
|
903
|
-
/**
|
|
904
|
-
* Whether this entity type is a scoped proxy.
|
|
905
|
-
*/
|
|
906
|
-
readonly scopedProxy: boolean;
|
|
956
|
+
interface ISystemsModuleBuilder<TEntity extends IEntity> extends ISystemsModuleBuilderReadonly<TEntity> {
|
|
957
|
+
readonly middlewareRegistry: MiddlewareRegistry;
|
|
907
958
|
/**
|
|
908
959
|
* Registers middleware systems for a specific pipeline stage.
|
|
909
960
|
* The middleware are added to the pipeline in the order provided.
|
|
@@ -936,6 +987,27 @@ interface ISystemsModuleBuilder<TEntity extends IEntity> {
|
|
|
936
987
|
setScopedProxy(): this;
|
|
937
988
|
}
|
|
938
989
|
//#endregion
|
|
990
|
+
//#region src/systems/module/systems-module.d.ts
|
|
991
|
+
/**
|
|
992
|
+
* Collection of pipelines for a specific entity type.
|
|
993
|
+
* Defines the complete system processing flow for one entity category.
|
|
994
|
+
*
|
|
995
|
+
* @template TEntity - The entity type this module processes.
|
|
996
|
+
*/
|
|
997
|
+
interface ISystemsModule<TEntity extends IEntity> {
|
|
998
|
+
/**
|
|
999
|
+
* The builder instance used to construct this module.
|
|
1000
|
+
*/
|
|
1001
|
+
readonly builder: ISystemsModuleBuilderReadonly<TEntity>;
|
|
1002
|
+
/**
|
|
1003
|
+
* Optional factory function to initialize new entity instances.
|
|
1004
|
+
* If provided, is called when a new entity of this type is created.
|
|
1005
|
+
* @param model - The initialization model.
|
|
1006
|
+
* @returns The initialized entity.
|
|
1007
|
+
*/
|
|
1008
|
+
readonly initEntity?: (model: IEntityModel) => TEntity;
|
|
1009
|
+
}
|
|
1010
|
+
//#endregion
|
|
939
1011
|
//#region src/systems/module/systems-module-repository.d.ts
|
|
940
1012
|
/**
|
|
941
1013
|
* Central registry for all systems modules in the ECS.
|
|
@@ -980,9 +1052,9 @@ interface ISystemsRuntime {
|
|
|
980
1052
|
* Processes a single entity update through its system pipeline.
|
|
981
1053
|
* If no update is provided, may dequeue one from an internal queue.
|
|
982
1054
|
* @param update - Optional specific update to process. If omitted, dequeues the next update.
|
|
983
|
-
* @returns
|
|
1055
|
+
* @returns Pipeline results containing execution data and metrics.
|
|
984
1056
|
*/
|
|
985
|
-
runTick(update?: IEntityUpdate):
|
|
1057
|
+
runTick(update?: IEntityUpdate): PipelineRuntime | Promise<PipelineRuntime> | void;
|
|
986
1058
|
}
|
|
987
1059
|
//#endregion
|
|
988
1060
|
//#region src/systems/runtime/systems-runtime-context.d.ts
|
|
@@ -1061,5 +1133,5 @@ interface ISystemsFactory {
|
|
|
1061
1133
|
createSystemsModuleBuilder<TEntity extends IEntity>(name: string): ISystemsModuleBuilder<TEntity>;
|
|
1062
1134
|
}
|
|
1063
1135
|
//#endregion
|
|
1064
|
-
export {
|
|
1065
|
-
//# sourceMappingURL=index-
|
|
1136
|
+
export { dispatchSequential as $, SystemModuleName as A, PipelineRuntime as B, ISystemContextControl as C, MiddlewareRegistry as D, ISystemMiddleware as E, IParentMiddleware as F, MiddlewareMetricsSummary as G, PerformanceMetricOptions as H, IPipeline as I, TickSnapshot as J, RenderSnapshot as K, IMiddlewareRunner as L, INestedContext as M, INestedMiddleware as N, MiddlewareRegistryReadonly as O, IParentContext as P, IJsonSerializer as Q, IMiddleware as R, ISystemContextEvents as S, SystemContextControlState as T, PerformanceTimeEntry as U, IPerformanceTimer as V, PerformanceTimerUid as W, ILoggerOptions as X, ILogger as Y, LogLevel as Z, ISystemContext as _, ISystemsRuntime as a, ISystemContextRepository as b, ISystemsModuleBuilder as c, IPipelineFactory as d, PipelineCategory as f, IMutableSystemContext as g, IContextFactory as h, ISystemsRuntimeContext as i, IPipelineRunner as j, SystemMiddlewareName as k, ISystemsModuleBuilderReadonly as l, PipelineOptions as m, IRuntimeFactory as n, ISystemsModuleRepository as o, PipelineCategoryName as p, TickMetricEntry as q, ISystemsRuntimeMiddleware as r, ISystemsModule as s, ISystemsFactory as t, SystemType as u, ISystemContextSnapshot as v, ISystemContextControlState as w, ISystemContextProxies as x, ISystemContextScheduler as y, IPipelineContext as z };
|
|
1137
|
+
//# sourceMappingURL=index-zohK7ftH.d.cts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as PipelineRuntime, F as IParentMiddleware, I as IPipeline, L as IMiddlewareRunner, M as INestedContext, N as INestedMiddleware, P as IParentContext, R as IMiddleware, j as IPipelineRunner, z as IPipelineContext } from "../index-zohK7ftH.cjs";
|
|
2
2
|
export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineRuntime };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { B as PipelineRuntime, F as IParentMiddleware, I as IPipeline, L as IMiddlewareRunner, M as INestedContext, N as INestedMiddleware, P as IParentContext, R as IMiddleware, j as IPipelineRunner, z as IPipelineContext } from "../index-DZlhICMZ.mjs";
|
|
2
2
|
export { IMiddleware, IMiddlewareRunner, INestedContext, INestedMiddleware, IParentContext, IParentMiddleware, IPipeline, IPipelineContext, IPipelineRunner, PipelineRuntime };
|
package/dist/systems/index.cjs
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/systems/pipeline/system-context-control.ts
|
|
3
|
+
let SystemContextControlState = /* @__PURE__ */ function(SystemContextControlState) {
|
|
4
|
+
SystemContextControlState["none"] = "none";
|
|
5
|
+
SystemContextControlState["enableCurrentSystem"] = "enableCurrentSystem";
|
|
6
|
+
SystemContextControlState["disableCurrentSystem"] = "disableCurrentSystem";
|
|
7
|
+
SystemContextControlState["enableCurrentModule"] = "enableCurrentModule";
|
|
8
|
+
SystemContextControlState["disableCurrentModule"] = "disableCurrentModule";
|
|
9
|
+
return SystemContextControlState;
|
|
10
|
+
}({});
|
|
11
|
+
//#endregion
|
|
2
12
|
//#region src/systems/system-type.ts
|
|
3
13
|
/**
|
|
4
14
|
* The four phases of entity system execution in each frame.
|
|
@@ -29,6 +39,7 @@ let SystemType = /* @__PURE__ */ function(SystemType) {
|
|
|
29
39
|
return SystemType;
|
|
30
40
|
}({});
|
|
31
41
|
//#endregion
|
|
42
|
+
exports.SystemContextControlState = SystemContextControlState;
|
|
32
43
|
exports.SystemType = SystemType;
|
|
33
44
|
|
|
34
45
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/systems/system-type.ts"],"sourcesContent":["/**\r\n * The four phases of entity system execution in each frame.\r\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\r\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\r\n */\r\nexport enum SystemType {\r\n /**\r\n * Initial setup and resource allocation for the entity.\r\n * Runs once when the entity is first created or initialized.\r\n */\r\n initialize = 0,\r\n\r\n /**\r\n * Main logic and state updates for the entity.\r\n * Runs on every update to change entity behavior and properties.\r\n */\r\n update = 1,\r\n\r\n /**\r\n * Output and visualization operations.\r\n * Runs after updates to render or display the entity state.\r\n */\r\n render = 2,\r\n\r\n /**\r\n * Synchronization and persistence.\r\n * Runs last to synchronize state with external systems or storage.\r\n */\r\n sync = 3\r\n}\r\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../../src/systems/pipeline/system-context-control.ts","../../src/systems/system-type.ts"],"sourcesContent":["import { IEntity } from '@awesome-ecs/abstract/entities';\r\nimport { ISystemMiddleware } from './system-middleware';\r\n\r\nexport enum SystemContextControlState {\r\n none = 'none',\r\n enableCurrentSystem = 'enableCurrentSystem',\r\n disableCurrentSystem = 'disableCurrentSystem',\r\n enableCurrentModule = 'enableCurrentModule',\r\n disableCurrentModule = 'disableCurrentModule'\r\n}\r\n\r\n/**\r\n * Interface for controlling the execution of systems and modules within a system context.\r\n * This allows middleware to enable or disable specific systems or entire modules for the current entity.\r\n */\r\nexport interface ISystemContextControl {\r\n /**\r\n * Disables the current system for the current entity.\r\n */\r\n disableCurrentSystem(): void;\r\n\r\n /**\r\n * Re-enables the current system for the current entity.\r\n */\r\n enableCurrentSystem(): void;\r\n\r\n /**\r\n * Disables the current module for the current entity.\r\n */\r\n disableCurrentModule(): void;\r\n\r\n /**\r\n * Re-enables the current module for the current entity.\r\n */\r\n enableCurrentModule(): void;\r\n}\r\n\r\n/**\r\n * Extended system context interface that includes control state for middleware to manage system and module execution.\r\n * This allows middleware to query and modify the execution state of systems and modules during pipeline processing.\r\n */\r\nexport interface ISystemContextControlState extends ISystemContextControl {\r\n /**\r\n * Current state of system/module execution control, indicating whether the current system or module is enabled or disabled.\r\n */\r\n readonly state: SystemContextControlState;\r\n\r\n /**\r\n * Checks if a specific middleware is currently disabled in the context, allowing middleware to conditionally execute logic based on the enabled/disabled state of other middleware.\r\n * @param middleware - The middleware to check for disabled state.\r\n * @returns True if the specified middleware is currently disabled, false otherwise.\r\n */\r\n isMiddlewareDisabled(middleware: ISystemMiddleware<IEntity>): boolean;\r\n\r\n /**\r\n * Disables a specific middleware in the context.\r\n * @param middleware - The middleware to disable.\r\n */\r\n disableMiddleware(middleware: ISystemMiddleware<IEntity>): void;\r\n\r\n /**\r\n * Enables a specific middleware in the context.\r\n * @param middleware - The middleware to enable.\r\n */\r\n enableMiddleware(middleware: ISystemMiddleware<IEntity>): void;\r\n\r\n /**\r\n * Disables an entire module of middleware in the context.\r\n * @param middleware - A middleware from the module to disable.\r\n */\r\n disableModule(middleware: ISystemMiddleware<IEntity>): void;\r\n\r\n /**\r\n * Enables an entire module of middleware in the context.\r\n * @param middleware - A middleware from the module to enable.\r\n */\r\n enableModule(middleware: ISystemMiddleware<IEntity>): void;\r\n}\r\n","/**\r\n * The four phases of entity system execution in each frame.\r\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\r\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\r\n */\r\nexport enum SystemType {\r\n /**\r\n * Initial setup and resource allocation for the entity.\r\n * Runs once when the entity is first created or initialized.\r\n */\r\n initialize = 0,\r\n\r\n /**\r\n * Main logic and state updates for the entity.\r\n * Runs on every update to change entity behavior and properties.\r\n */\r\n update = 1,\r\n\r\n /**\r\n * Output and visualization operations.\r\n * Runs after updates to render or display the entity state.\r\n */\r\n render = 2,\r\n\r\n /**\r\n * Synchronization and persistence.\r\n * Runs last to synchronize state with external systems or storage.\r\n */\r\n sync = 3\r\n}\r\n"],"mappings":";;AAGA,IAAY,4BAAL,yBAAA,2BAAA;AACL,2BAAA,UAAA;AACA,2BAAA,yBAAA;AACA,2BAAA,0BAAA;AACA,2BAAA,yBAAA;AACA,2BAAA,0BAAA;;KACD;;;;;;;;ACJD,IAAY,aAAL,yBAAA,YAAA;;;;;AAKL,YAAA,WAAA,gBAAA,KAAA;;;;;AAMA,YAAA,WAAA,YAAA,KAAA;;;;;AAMA,YAAA,WAAA,YAAA,KAAA;;;;;AAMA,YAAA,WAAA,UAAA,KAAA;;KACD"}
|
package/dist/systems/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as ISystemContextEvents, _ as ISystemContext, a as ISystemsRuntime, b as ISystemContextRepository, c as
|
|
2
|
-
export { IMutableSystemContext, ISystemContext, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
|
|
1
|
+
import { A as SystemModuleName, C as ISystemContextControl, D as MiddlewareRegistry, E as ISystemMiddleware, O as MiddlewareRegistryReadonly, S as ISystemContextEvents, T as SystemContextControlState, _ as ISystemContext, a as ISystemsRuntime, b as ISystemContextRepository, c as ISystemsModuleBuilder, g as IMutableSystemContext, i as ISystemsRuntimeContext, k as SystemMiddlewareName, l as ISystemsModuleBuilderReadonly, o as ISystemsModuleRepository, r as ISystemsRuntimeMiddleware, s as ISystemsModule, u as SystemType, v as ISystemContextSnapshot, w as ISystemContextControlState, x as ISystemContextProxies, y as ISystemContextScheduler } from "../index-zohK7ftH.cjs";
|
|
2
|
+
export { IMutableSystemContext, ISystemContext, ISystemContextControl, ISystemContextControlState, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleBuilderReadonly, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, MiddlewareRegistry, MiddlewareRegistryReadonly, SystemContextControlState, SystemMiddlewareName, SystemModuleName, SystemType };
|
package/dist/systems/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { S as ISystemContextEvents, _ as ISystemContext, a as ISystemsRuntime, b as ISystemContextRepository, c as
|
|
2
|
-
export { IMutableSystemContext, ISystemContext, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, SystemType };
|
|
1
|
+
import { A as SystemModuleName, C as ISystemContextControl, D as MiddlewareRegistry, E as ISystemMiddleware, O as MiddlewareRegistryReadonly, S as ISystemContextEvents, T as SystemContextControlState, _ as ISystemContext, a as ISystemsRuntime, b as ISystemContextRepository, c as ISystemsModuleBuilder, g as IMutableSystemContext, i as ISystemsRuntimeContext, k as SystemMiddlewareName, l as ISystemsModuleBuilderReadonly, o as ISystemsModuleRepository, r as ISystemsRuntimeMiddleware, s as ISystemsModule, u as SystemType, v as ISystemContextSnapshot, w as ISystemContextControlState, x as ISystemContextProxies, y as ISystemContextScheduler } from "../index-DZlhICMZ.mjs";
|
|
2
|
+
export { IMutableSystemContext, ISystemContext, ISystemContextControl, ISystemContextControlState, ISystemContextEvents, ISystemContextProxies, ISystemContextRepository, ISystemContextScheduler, ISystemContextSnapshot, ISystemMiddleware, ISystemsModule, ISystemsModuleBuilder, ISystemsModuleBuilderReadonly, ISystemsModuleRepository, ISystemsRuntime, ISystemsRuntimeContext, ISystemsRuntimeMiddleware, MiddlewareRegistry, MiddlewareRegistryReadonly, SystemContextControlState, SystemMiddlewareName, SystemModuleName, SystemType };
|
package/dist/systems/index.mjs
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
//#region src/systems/pipeline/system-context-control.ts
|
|
2
|
+
let SystemContextControlState = /* @__PURE__ */ function(SystemContextControlState) {
|
|
3
|
+
SystemContextControlState["none"] = "none";
|
|
4
|
+
SystemContextControlState["enableCurrentSystem"] = "enableCurrentSystem";
|
|
5
|
+
SystemContextControlState["disableCurrentSystem"] = "disableCurrentSystem";
|
|
6
|
+
SystemContextControlState["enableCurrentModule"] = "enableCurrentModule";
|
|
7
|
+
SystemContextControlState["disableCurrentModule"] = "disableCurrentModule";
|
|
8
|
+
return SystemContextControlState;
|
|
9
|
+
}({});
|
|
10
|
+
//#endregion
|
|
1
11
|
//#region src/systems/system-type.ts
|
|
2
12
|
/**
|
|
3
13
|
* The four phases of entity system execution in each frame.
|
|
@@ -28,6 +38,6 @@ let SystemType = /* @__PURE__ */ function(SystemType) {
|
|
|
28
38
|
return SystemType;
|
|
29
39
|
}({});
|
|
30
40
|
//#endregion
|
|
31
|
-
export { SystemType };
|
|
41
|
+
export { SystemContextControlState, SystemType };
|
|
32
42
|
|
|
33
43
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/systems/system-type.ts"],"sourcesContent":["/**\r\n * The four phases of entity system execution in each frame.\r\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\r\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\r\n */\r\nexport enum SystemType {\r\n /**\r\n * Initial setup and resource allocation for the entity.\r\n * Runs once when the entity is first created or initialized.\r\n */\r\n initialize = 0,\r\n\r\n /**\r\n * Main logic and state updates for the entity.\r\n * Runs on every update to change entity behavior and properties.\r\n */\r\n update = 1,\r\n\r\n /**\r\n * Output and visualization operations.\r\n * Runs after updates to render or display the entity state.\r\n */\r\n render = 2,\r\n\r\n /**\r\n * Synchronization and persistence.\r\n * Runs last to synchronize state with external systems or storage.\r\n */\r\n sync = 3\r\n}\r\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/systems/pipeline/system-context-control.ts","../../src/systems/system-type.ts"],"sourcesContent":["import { IEntity } from '@awesome-ecs/abstract/entities';\r\nimport { ISystemMiddleware } from './system-middleware';\r\n\r\nexport enum SystemContextControlState {\r\n none = 'none',\r\n enableCurrentSystem = 'enableCurrentSystem',\r\n disableCurrentSystem = 'disableCurrentSystem',\r\n enableCurrentModule = 'enableCurrentModule',\r\n disableCurrentModule = 'disableCurrentModule'\r\n}\r\n\r\n/**\r\n * Interface for controlling the execution of systems and modules within a system context.\r\n * This allows middleware to enable or disable specific systems or entire modules for the current entity.\r\n */\r\nexport interface ISystemContextControl {\r\n /**\r\n * Disables the current system for the current entity.\r\n */\r\n disableCurrentSystem(): void;\r\n\r\n /**\r\n * Re-enables the current system for the current entity.\r\n */\r\n enableCurrentSystem(): void;\r\n\r\n /**\r\n * Disables the current module for the current entity.\r\n */\r\n disableCurrentModule(): void;\r\n\r\n /**\r\n * Re-enables the current module for the current entity.\r\n */\r\n enableCurrentModule(): void;\r\n}\r\n\r\n/**\r\n * Extended system context interface that includes control state for middleware to manage system and module execution.\r\n * This allows middleware to query and modify the execution state of systems and modules during pipeline processing.\r\n */\r\nexport interface ISystemContextControlState extends ISystemContextControl {\r\n /**\r\n * Current state of system/module execution control, indicating whether the current system or module is enabled or disabled.\r\n */\r\n readonly state: SystemContextControlState;\r\n\r\n /**\r\n * Checks if a specific middleware is currently disabled in the context, allowing middleware to conditionally execute logic based on the enabled/disabled state of other middleware.\r\n * @param middleware - The middleware to check for disabled state.\r\n * @returns True if the specified middleware is currently disabled, false otherwise.\r\n */\r\n isMiddlewareDisabled(middleware: ISystemMiddleware<IEntity>): boolean;\r\n\r\n /**\r\n * Disables a specific middleware in the context.\r\n * @param middleware - The middleware to disable.\r\n */\r\n disableMiddleware(middleware: ISystemMiddleware<IEntity>): void;\r\n\r\n /**\r\n * Enables a specific middleware in the context.\r\n * @param middleware - The middleware to enable.\r\n */\r\n enableMiddleware(middleware: ISystemMiddleware<IEntity>): void;\r\n\r\n /**\r\n * Disables an entire module of middleware in the context.\r\n * @param middleware - A middleware from the module to disable.\r\n */\r\n disableModule(middleware: ISystemMiddleware<IEntity>): void;\r\n\r\n /**\r\n * Enables an entire module of middleware in the context.\r\n * @param middleware - A middleware from the module to enable.\r\n */\r\n enableModule(middleware: ISystemMiddleware<IEntity>): void;\r\n}\r\n","/**\r\n * The four phases of entity system execution in each frame.\r\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\r\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\r\n */\r\nexport enum SystemType {\r\n /**\r\n * Initial setup and resource allocation for the entity.\r\n * Runs once when the entity is first created or initialized.\r\n */\r\n initialize = 0,\r\n\r\n /**\r\n * Main logic and state updates for the entity.\r\n * Runs on every update to change entity behavior and properties.\r\n */\r\n update = 1,\r\n\r\n /**\r\n * Output and visualization operations.\r\n * Runs after updates to render or display the entity state.\r\n */\r\n render = 2,\r\n\r\n /**\r\n * Synchronization and persistence.\r\n * Runs last to synchronize state with external systems or storage.\r\n */\r\n sync = 3\r\n}\r\n"],"mappings":";AAGA,IAAY,4BAAL,yBAAA,2BAAA;AACL,2BAAA,UAAA;AACA,2BAAA,yBAAA;AACA,2BAAA,0BAAA;AACA,2BAAA,yBAAA;AACA,2BAAA,0BAAA;;KACD;;;;;;;;ACJD,IAAY,aAAL,yBAAA,YAAA;;;;;AAKL,YAAA,WAAA,gBAAA,KAAA;;;;;AAMA,YAAA,WAAA,YAAA,KAAA;;;;;AAMA,YAAA,WAAA,YAAA,KAAA;;;;;AAMA,YAAA,WAAA,UAAA,KAAA;;KACD"}
|
package/dist/utils/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as ImmutableArray, c as ImmutableObjectDeep, d as MutableDeep, i as Immutable, l as ImmutableSet, o as ImmutableMap, r as BooleanProps, s as ImmutableObject, u as Mutable } from "../identity-component-DLDaOTyK.cjs";
|
|
2
|
-
import {
|
|
2
|
+
import { $ as dispatchSequential, G as MiddlewareMetricsSummary, H as PerformanceMetricOptions, J as TickSnapshot, K as RenderSnapshot, Q as IJsonSerializer, U as PerformanceTimeEntry, V as IPerformanceTimer, W as PerformanceTimerUid, X as ILoggerOptions, Y as ILogger, Z as LogLevel, q as TickMetricEntry } from "../index-zohK7ftH.cjs";
|
|
3
3
|
export { BooleanProps, IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, LogLevel, MiddlewareMetricsSummary, Mutable, MutableDeep, PerformanceMetricOptions, PerformanceTimeEntry, PerformanceTimerUid, RenderSnapshot, TickMetricEntry, TickSnapshot, dispatchSequential };
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { a as ImmutableArray, c as ImmutableObjectDeep, d as MutableDeep, i as Immutable, l as ImmutableSet, o as ImmutableMap, r as BooleanProps, s as ImmutableObject, u as Mutable } from "../identity-component-CuWHf7jX.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { $ as dispatchSequential, G as MiddlewareMetricsSummary, H as PerformanceMetricOptions, J as TickSnapshot, K as RenderSnapshot, Q as IJsonSerializer, U as PerformanceTimeEntry, V as IPerformanceTimer, W as PerformanceTimerUid, X as ILoggerOptions, Y as ILogger, Z as LogLevel, q as TickMetricEntry } from "../index-DZlhICMZ.mjs";
|
|
3
3
|
export { BooleanProps, IJsonSerializer, ILogger, ILoggerOptions, IPerformanceTimer, Immutable, ImmutableArray, ImmutableMap, ImmutableObject, ImmutableObjectDeep, ImmutableSet, LogLevel, MiddlewareMetricsSummary, Mutable, MutableDeep, PerformanceMetricOptions, PerformanceTimeEntry, PerformanceTimerUid, RenderSnapshot, TickMetricEntry, TickSnapshot, dispatchSequential };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@awesome-ecs/abstract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "A comprehensive Entity-Component-System (ECS) Architecture implementation. Abstract components.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"url": "https://github.com/privatebytes/awesome-ecs/issues"
|
|
98
98
|
},
|
|
99
99
|
"homepage": "https://github.com/privatebytes/awesome-ecs#readme",
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "23e307e2b48e442855dc940daad1c18985d9d94d"
|
|
101
101
|
}
|