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

20 lines
713 B
TypeScript
Raw Permalink Normal View History

2022-11-26 01:22:02 +00:00
import { BaseComponent, Component } from './component';
export declare class BaseEntity {
id: number;
components: Map<number, BaseComponent>;
constructor();
addComponent(component: Component): void;
removeComponent(component: BaseComponent): void;
getComponentIDs(): number[];
getComponent(component: BaseComponent): BaseComponent;
getComponentByID(id: number): BaseComponent;
}
export interface Entity {
new (): BaseComponent;
addComponent(component: Component): any;
removeComponent(component: BaseComponent): any;
getComponentIDs(): number[];
getComponent(component: BaseComponent): any;
getComponentByID(id: number): BaseComponent;
}