mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-09 22:02:45 +08:00
44 lines
739 B
TypeScript
44 lines
739 B
TypeScript
/*
|
|
* @Author: dgflash
|
|
* @Date: 2022-06-21 12:05:14
|
|
* @LastEditors: dgflash
|
|
* @LastEditTime: 2022-07-20 14:04:44
|
|
*/
|
|
import { IControl } from './IControl';
|
|
|
|
/** 行为树节点 */
|
|
export abstract class BTreeNode implements IControl {
|
|
protected _control!: IControl;
|
|
|
|
title: string;
|
|
|
|
constructor() {
|
|
this.title = this.constructor.name;
|
|
}
|
|
|
|
start(blackboard?: any) {
|
|
|
|
}
|
|
|
|
end(blackboard?: any) {
|
|
|
|
}
|
|
|
|
abstract run(blackboard?: any): void;
|
|
|
|
setControl(control: IControl) {
|
|
this._control = control;
|
|
}
|
|
|
|
running(blackboard?: any) {
|
|
this._control.running(this);
|
|
}
|
|
|
|
success() {
|
|
this._control.success();
|
|
}
|
|
|
|
fail() {
|
|
this._control.fail();
|
|
}
|
|
} |