var t = require; var e = module; var i = exports; Object.defineProperty(i, "__esModule", {value: !0}); const s = t("constants"), o = t("Decorator"); i.default = class extends o.default { constructor({child: t = null, maxLoop: e} = {}) { if ((super({child: t, name: "Limiter", title: "Limit Activations", properties: {maxLoop: 1}}), !e)) throw "maxLoop parameter in Limiter decorator is an obligatory parameter"; this.maxLoop = e; } open(t) { t.blackboard.get("i", t.tree.id, this.id) || t.blackboard.set("i", 0, t.tree.id, this.id); } tick(t) { if (!this.child) return s.ERROR; var e = t.blackboard.get("i", t.tree.id, this.id); if (e < this.maxLoop) { var i = this.child._execute(t); return (i != s.SUCCESS && i != s.FAILURE) || t.blackboard.set("i", e + 1, t.tree.id, this.id), i; } return s.FAILURE; } };