import { System } from './System'; import * as EventEmitter from "eventemitter3"; import { ComponentBitmaskMap } from './ComponentBitmaskMap'; import { Entity, EntityProp } from './Entity'; export declare class EntitySystemManager { private componentBitmask; private _events; private ids; private systems; private _systemUpdateMethods; constructor(componentBitmaskMap: ComponentBitmaskMap, events: EventEmitter); /** * update the system bitmask * @param system * @param componentMask */ updateBitmask(system: System, componentMask?: { new (config?: { [x: string]: any; }): any; }[]): System; /** * Add the system to the ECS so its methods will be called by the update methods * Before the existing entities get added into the system the setUp method is called * @param system * @param componentMask - componentBitmask for the System * @param silent - if true the ECS wont be notified that a System got added to the ECS */ add(system: T, componentMask?: { new (config?: { [x: string]: any; }): any; }[], silent?: boolean): T; /** * Checks if the system is in the ECS * @param system * @returns {boolean} */ has(system: System): boolean; /** * Checks if a system of the class exists in the ECS * @param constructor * @returns {boolean} */ hasOf(constructor: { new (config?: { [x: string]: any; }): T; }): boolean; /** * Removes the system * @param system * @param silent * @returns {boolean} */ remove(system: System, silent?: boolean): boolean; /** * Removes the System of the provided type from the ECS * @param constructor * @param silent * @returns {boolean} */ removeOf(constructor: { new (config?: { [x: string]: any; }): T; }, silent?: boolean): boolean; /** * Returns entities for the system of the type if it exists in the ECS * @param constructor * @returns {undefined|Map} */ getEntitiesOf(constructor: { new (config?: { [x: string]: any; }): T; }): Entity[]; getComponentMaskOf(constructor: { new (config?: { [x: string]: any; }): T; }): number; get(constructor: { new (config?: { [x: string]: any; }): T; }): T; /** * Adds the entity to the system, or adds it to all Systems * @param entity * @param system - optional system to add the entity to */ addEntity(entity: EntityProp, system?: System): void; /** * Removes an entity from the system or all systems * @param entity * @param system */ removeEntity(entity: EntityProp, system?: System): void; /** * Updates the Entity adds it to the right systems and removes it from systems if it does not fit anymore * @param entity * @param system - optional only update for for the given system(ether add or remove the entity from the system) */ updateEntity(entity: EntityProp, system?: System): void; private updateSystemEntity; private addEntityToSystem; /** * Calls the Method for all Systems and Subsystems */ callSystemMethod(id: string, a1?: any, a2?: any, a3?: any, a4?: any, a5?: any, a6?: any, a7?: any, a8?: any, a9?: any): void; /** * Calls all system update methods for all system and child systems */ update(a1?: any, a2?: any, a3?: any, a4?: any, a5?: any, a6?: any, a7?: any, a8?: any, a9?: any): void; /** * Injects the SystemMethods into all systems if the methods does not exist a noop method will be added */ updateSystemMethods(): void; readonly events: EventEmitter; systemUpdateMethods: string[]; }