import { Thing } from "./thing"; import { IComponent, Component } from './component'; import { Undefinable, Nullable } from '../utils/types'; import { ITimer } from ".."; export interface IObjectAdapter { createHostObject: Function; } export interface IEntityOptions { objectAdapter?: IObjectAdapter; [key: string]: any; } export interface IRunEvent { init: Function; beforeupdate: Function; afterupdate: Function; } /** * 场景的编译,当改变属性的时候应该实时的更新模型的属性状态,最终编译的时候已经转换到THREE * entity下的object是固定的Object3D,当他的组件形成构成新的模型都是放在object3d * Component下的renderObject是变动的模型,大部分和ctype相关 */ export declare class Entity extends Thing implements IRunEvent { _components: IComponent[]; _componentMap: Map; objectAdapter: Undefinable; object: any; _compileCache: any; constructor(options?: IEntityOptions); init(): void; get components(): IComponent[]; /** * 添加组件 * @param com 组件 * @returns 是否添加成功 */ addComponent(com: IComponent | Component): boolean; removeComponent(com: IComponent): Nullable; updateComponents(): void; beforeupdate(): void; afterupdate(): void; update(timer: ITimer): void; nextStep(timer: ITimer): void; }