Files
esengine/source/src/ECS/Components/IUpdatable.ts

21 lines
643 B
TypeScript
Raw Normal View History

module es {
/**
* Component时Component和实体被启用
*/
2020-10-27 18:08:49 +08:00
export interface IUpdatable {
enabled: boolean;
updateOrder: number;
update();
}
/**
*
*/
2020-10-27 18:08:49 +08:00
export class IUpdatableComparer implements IComparer<IUpdatable> {
public compare(a: IUpdatable, b: IUpdatable) {
2020-07-28 16:25:20 +08:00
return a.updateOrder - b.updateOrder;
}
}
export var isIUpdatable = (props: any): props is IUpdatable => typeof (props as IUpdatable)['js'] !== 'undefined';
}