123456789101112131415161718192021222324252627282930313233343536373839404142 |
- var t = require;
- var e = module;
- var i = exports;
- Object.defineProperty(i, "__esModule", {value: !0});
- const s = t("Actions"),
- o = t("BaseAction"),
- a = t("constants"),
- n = t("BehaviorTree");
- class r extends o.default {
- constructor() {
- super(...arguments), (this.tree = null);
- }
- static setSubTreeLoadFunc(t) {
- this.subTreeLoadFunc = t;
- }
- set properties(t) {
- (this._properties = t), this._properties.path && r.subTreeLoadFunc(this);
- }
- get properties() {
- return this._properties;
- }
- loadDataFinish(t) {
- (this.tree = new n.default()), this.tree.load(t, s.Actions);
- }
- open(t) {}
- tick(t) {
- return this.tree ? this.tree.tick(t.target, t.blackboard) : a.RUNNING;
- }
- interrupt(i) {
- var s = i.blackboard.get("openNodes", this.tree.id);
- if (s) {
- var t = i.tree;
- i.tree = this.tree;
- for (let e = 0; e < s.length; e++) {
- let t = s[e];
- t._close(i), t.interrupt && t.interrupt(i);
- }
- i.tree = t;
- }
- }
- }
- i.default = r;
|