assassin-bug/framework/ecs/index.d.ts

29 lines
1.1 KiB
TypeScript
Raw Permalink Normal View History

2022-11-26 01:22:02 +00:00
import { Component } from './component';
import { BaseEntity, Entity } from './entity';
import { EventBus } from '../event-bus';
import { Query } from './query';
import { System } from './system';
export declare class World {
entities: Array<BaseEntity>;
components: Map<number, Component>;
componentNamesToIDs: Map<string, number>;
systems: Set<System>;
nextEntityID: number;
nextComponentID: number;
nextQueryID: number;
queryCache: Array<Query>;
eventBus: EventBus;
constructor();
run(): void;
createSystem(systemExecutor: Function): void;
addSystem(system: System): void;
addEntity(entity: BaseEntity): void;
removeEntity(entityToRemove: BaseEntity): void;
createEntity(components: Array<Component>): BaseEntity;
extendEntity(entity: Entity, components: Array<Component>): BaseEntity;
createComponent(component: Component): Component;
query(include: Array<Component>, exclude: Array<Component>): Array<BaseEntity>;
createQuery(include: Array<Component>, exclude: Array<Component>): Query;
markQueriesDirty(): void;
}