mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-22 17:06:53 +08:00
28 lines
542 B
TypeScript
28 lines
542 B
TypeScript
/*
|
|
* @Author: dgflash
|
|
* @Date: 2022-06-21 12:05:14
|
|
* @LastEditors: dgflash
|
|
* @LastEditTime: 2022-07-20 14:08:10
|
|
*/
|
|
import { BranchNode } from './BranchNode';
|
|
|
|
/** 优先 */
|
|
export class Priority extends BranchNode {
|
|
success() {
|
|
super.success();
|
|
this._control.success();
|
|
}
|
|
|
|
fail() {
|
|
super.fail();
|
|
|
|
this._actualTask += 1;
|
|
if (this._actualTask < this.children.length) {
|
|
this._run(this._blackboard);
|
|
}
|
|
else {
|
|
this._control.fail();
|
|
}
|
|
}
|
|
}
|