{"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';\nimport { ISystemMiddleware } from './system-middleware';\n\nexport enum SystemContextControlState {\n  none = 'none',\n  enableCurrentSystem = 'enableCurrentSystem',\n  disableCurrentSystem = 'disableCurrentSystem',\n  enableCurrentModule = 'enableCurrentModule',\n  disableCurrentModule = 'disableCurrentModule'\n}\n\n/**\n * Interface for controlling the execution of systems and modules within a system context.\n * This allows middleware to enable or disable specific systems or entire modules for the current entity.\n */\nexport interface ISystemContextControl {\n  /**\n   * Disables the current system for the current entity.\n   */\n  disableCurrentSystem(): void;\n\n  /**\n   * Re-enables the current system for the current entity.\n   */\n  enableCurrentSystem(): void;\n\n  /**\n   * Disables the current module for the current entity.\n   */\n  disableCurrentModule(): void;\n\n  /**\n   * Re-enables the current module for the current entity.\n   */\n  enableCurrentModule(): void;\n}\n\n/**\n * Extended system context interface that includes control state for middleware to manage system and module execution.\n * This allows middleware to query and modify the execution state of systems and modules during pipeline processing.\n */\nexport interface ISystemContextControlState extends ISystemContextControl {\n  /**\n   * Current state of system/module execution control, indicating whether the current system or module is enabled or disabled.\n   */\n  readonly state: SystemContextControlState;\n\n  /**\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.\n   * @param middleware - The middleware to check for disabled state.\n   * @returns True if the specified middleware is currently disabled, false otherwise.\n   */\n  isMiddlewareDisabled(middleware: ISystemMiddleware<IEntity>): boolean;\n\n  /**\n   * Disables a specific middleware in the context.\n   * @param middleware - The middleware to disable.\n   */\n  disableMiddleware(middleware: ISystemMiddleware<IEntity>): void;\n\n  /**\n   * Enables a specific middleware in the context.\n   * @param middleware - The middleware to enable.\n   */\n  enableMiddleware(middleware: ISystemMiddleware<IEntity>): void;\n\n  /**\n   * Disables an entire module of middleware in the context.\n   * @param middleware - A middleware from the module to disable.\n   */\n  disableModule(middleware: ISystemMiddleware<IEntity>): void;\n\n  /**\n   * Enables an entire module of middleware in the context.\n   * @param middleware - A middleware from the module to enable.\n   */\n  enableModule(middleware: ISystemMiddleware<IEntity>): void;\n}\n","/**\n * The five phases of entity system execution in each frame.\n * Each phase serves a specific purpose in the entity lifecycle and can be extended by custom system types.\n * The runtime handles each phase in order, allowing systems to perform stage-specific operations.\n */\nexport enum SystemType {\n  /**\n   * Initial setup and resource allocation for the entity.\n   * Runs once when the entity is first created or initialized.\n   */\n  initialize = 0,\n\n  /**\n   * Config application and config-dependent resource reconciliation.\n   * Runs on entity creation and on updates that carry a config payload.\n   */\n  config = 1,\n\n  /**\n   * Main logic and state updates for the entity.\n   * Runs on every update to change entity behavior and properties.\n   */\n  update = 2,\n\n  /**\n   * Output and visualization operations.\n   * Runs after updates to render or display the entity state.\n   */\n  render = 3,\n\n  /**\n   * Synchronization and persistence.\n   * Runs last to synchronize state with external systems or storage.\n   */\n  sync = 4\n}\n"],"mappings":";AAGA,IAAY,4BAAL,yBAAA,2BAAA;CACL,0BAAA,UAAA;CACA,0BAAA,yBAAA;CACA,0BAAA,0BAAA;CACA,0BAAA,yBAAA;CACA,0BAAA,0BAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;;ACJA,IAAY,aAAL,yBAAA,YAAA;;;;;CAKL,WAAA,WAAA,gBAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,YAAA,KAAA;;;;;CAMA,WAAA,WAAA,UAAA,KAAA;;AACF,EAAA,CAAA,CAAA"}