import type { App } from "./App"; import type { ComponentConstructor } from "./Component"; import type { Entity } from "./Entity"; declare abstract class System { static readonly isSystem = true; private set; static readonly components: ReadonlyArray; /** * A system is pure if the result of its test function is only dependent on * the presence of components or is otherwise static for the entity (e.g., * the entity's class or readonly properties). */ abstract readonly pure: boolean; abstract test(entity: Entity | T): entity is T; private _add; add(...entites: Entity[]): void; private _remove; remove(...entites: Entity[]): void; /** * If the passed entity satisifies `test`, then the entity is added to the * system. Otherwise, it is removed. */ check(entity: Entity): void; preUpdate(delta: number, time: number): void; postUpdate(delta: number, time: number): void; preRender(delta: number, time: number): void; postRender(delta: number, time: number): void; dispose(): void; [Symbol.iterator](): IterableIterator; addToApp(app: App): this; } interface System { update?(entity: T, delta: number, time: number): void; render?(entity: T, delta: number, time: number): void; onAddEntity?(entity: T): void; onRemoveEntity?(entity: Entity): void; modified?(entity: Entity): void; } export { System };