123456789101112131415161718192021 |
- var t = require;
- var e = module;
- var i = exports;
- Object.defineProperty(i, "__esModule", {value: !0}), (i.DebugTree = void 0);
- const s = t("BehaviorTree"),
- l = t("Tick");
- i.DebugTree = class extends s.default {
- tick(t, e) {
- if (!e) throw "The blackboard parameter is obligatory and must be an instance of b3.Blackboard";
- let i = new l.default();
- (i.debug = this.debug), (i.target = t), (i.blackboard = e);
- let s,
- o = (i.tree = this).root._execute(i),
- a = e.get("openNodes", this.id),
- n = i._openNodes.slice(0),
- r = 0;
- for (s = 0; s < Math.min(a.length, n.length) && ((r = s + 1), e.get("openNodes", this.id), a[s] === n[s]); s++);
- for (s = a.length - 1; s >= r; s--) a[s]._close(i);
- return e.set("openNodes", n, this.id), e.set("nodeCount", i._nodeCount, this.id), o;
- }
- };
|