2020-07-22 23:30:31 +08:00
|
|
|
|
module es {
|
2020-11-23 16:05:06 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 接口,当添加到一个Component时,只要Component和实体被启用,它就会在每个框架中调用更新方法。
|
|
|
|
|
|
*/
|
2020-10-27 18:08:49 +08:00
|
|
|
|
export interface IUpdatable {
|
|
|
|
|
|
enabled: boolean;
|
|
|
|
|
|
updateOrder: number;
|
|
|
|
|
|
update();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2020-07-22 23:30:31 +08:00
|
|
|
|
/**
|
|
|
|
|
|
* 用于比较组件更新排序
|
|
|
|
|
|
*/
|
2020-10-27 18:08:49 +08:00
|
|
|
|
export class IUpdatableComparer implements IComparer<IUpdatable> {
|
2020-11-23 16:05:06 +08:00
|
|
|
|
public compare(a: IUpdatable, b: IUpdatable) {
|
2020-07-28 16:25:20 +08:00
|
|
|
|
return a.updateOrder - b.updateOrder;
|
|
|
|
|
|
}
|
2020-07-22 23:30:31 +08:00
|
|
|
|
}
|
2020-11-23 16:05:06 +08:00
|
|
|
|
|
|
|
|
|
|
export var isIUpdatable = (props: any): props is IUpdatable => typeof (props as IUpdatable)['js'] !== 'undefined';
|
2020-07-22 23:30:31 +08:00
|
|
|
|
}
|