mirror of
https://github.com/gongxh0901/kunpocc-behaviortree.git
synced 2025-12-26 16:48:56 +00:00
修改节点注释,重写文档
This commit is contained in:
@@ -4,7 +4,7 @@ import { Status } from "../header";
|
||||
export interface IBTNode {
|
||||
readonly children: IBTNode[];
|
||||
/** 本节点的的黑板引用 */
|
||||
blackboard: IBlackboard;
|
||||
local: IBlackboard;
|
||||
/**
|
||||
* 初始化节点
|
||||
* @param root 树根节点的黑板
|
||||
@@ -33,6 +33,9 @@ export interface IBTNode {
|
||||
*/
|
||||
setGlobal<T>(key: string, value: T): void;
|
||||
getGlobal<T>(key: string): T;
|
||||
|
||||
/** 获取关联的实体 */
|
||||
getEntity<T>(): T;
|
||||
}
|
||||
|
||||
|
||||
@@ -126,6 +129,10 @@ export abstract class BTNode implements IBTNode {
|
||||
}
|
||||
}
|
||||
|
||||
public getEntity<T>(): T {
|
||||
return this._local.getEntity();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置获取全局黑板数据
|
||||
*/
|
||||
@@ -162,8 +169,4 @@ export abstract class BTNode implements IBTNode {
|
||||
public get local(): IBlackboard {
|
||||
return this._local;
|
||||
}
|
||||
|
||||
public get blackboard(): IBlackboard {
|
||||
return this._local;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user