mirror of
https://gitee.com/sli97/behavior-eden-coco-plugin.git
synced 2025-10-09 16:46:13 +00:00
init
This commit is contained in:
7
dist/runtime/node/base/Action.js
vendored
Normal file
7
dist/runtime/node/base/Action.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Action = void 0;
|
||||
const Node_1 = require("./Node");
|
||||
class Action extends Node_1.Node {
|
||||
}
|
||||
exports.Action = Action;
|
12
dist/runtime/node/base/Composite.js
vendored
Normal file
12
dist/runtime/node/base/Composite.js
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Composite = void 0;
|
||||
const enum_1 = require("../enum");
|
||||
const ParentNode_1 = require("./ParentNode");
|
||||
class Composite extends ParentNode_1.ParentNode {
|
||||
constructor() {
|
||||
super(...arguments);
|
||||
this.abortType = enum_1.AbortType.None;
|
||||
}
|
||||
}
|
||||
exports.Composite = Composite;
|
7
dist/runtime/node/base/Condition.js
vendored
Normal file
7
dist/runtime/node/base/Condition.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Condition = void 0;
|
||||
const Node_1 = require("./Node");
|
||||
class Condition extends Node_1.Node {
|
||||
}
|
||||
exports.Condition = Condition;
|
7
dist/runtime/node/base/Decorator.js
vendored
Normal file
7
dist/runtime/node/base/Decorator.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Decorator = void 0;
|
||||
const ParentNode_1 = require("./ParentNode");
|
||||
class Decorator extends ParentNode_1.ParentNode {
|
||||
}
|
||||
exports.Decorator = Decorator;
|
27
dist/runtime/node/base/Node.js
vendored
Normal file
27
dist/runtime/node/base/Node.js
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Node = void 0;
|
||||
const enum_1 = require("../enum");
|
||||
class Node {
|
||||
constructor() {
|
||||
// 从json文件得到的节点数据
|
||||
this.data = {};
|
||||
this._status = enum_1.NodeStatus.Inactive;
|
||||
}
|
||||
get status() {
|
||||
return this._status;
|
||||
}
|
||||
set status(newStatus) {
|
||||
this._status = newStatus;
|
||||
}
|
||||
onStart() {
|
||||
this.status = enum_1.NodeStatus.Running;
|
||||
}
|
||||
onUpdate() {
|
||||
return enum_1.NodeStatus.Failure;
|
||||
}
|
||||
onEnd() {
|
||||
this.status = enum_1.NodeStatus.Inactive;
|
||||
}
|
||||
}
|
||||
exports.Node = Node;
|
34
dist/runtime/node/base/ParentNode.js
vendored
Normal file
34
dist/runtime/node/base/ParentNode.js
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ParentNode = void 0;
|
||||
const Node_1 = require("./Node");
|
||||
class ParentNode extends Node_1.Node {
|
||||
get index() {
|
||||
return this._index;
|
||||
}
|
||||
set index(data) {
|
||||
this._index = data;
|
||||
}
|
||||
constructor(children) {
|
||||
super();
|
||||
this.children = [];
|
||||
this._index = 0;
|
||||
this.children = children;
|
||||
}
|
||||
setChildren(children) {
|
||||
this.children = children;
|
||||
}
|
||||
onConditionalAbort(childIndex) { }
|
||||
decorate(status) {
|
||||
return status;
|
||||
}
|
||||
//并行节点的状态不由某个子节点状态决定,而是由多个共同决定,所以重新计算status
|
||||
overrideStatus(status) {
|
||||
return status;
|
||||
}
|
||||
canRunParallelChildren() {
|
||||
return false;
|
||||
}
|
||||
onChildStarted() { }
|
||||
}
|
||||
exports.ParentNode = ParentNode;
|
22
dist/runtime/node/base/index.js
vendored
Normal file
22
dist/runtime/node/base/index.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./Node"), exports);
|
||||
__exportStar(require("./Action"), exports);
|
||||
__exportStar(require("./Composite"), exports);
|
||||
__exportStar(require("./Condition"), exports);
|
||||
__exportStar(require("./Decorator"), exports);
|
||||
__exportStar(require("./ParentNode"), exports);
|
Reference in New Issue
Block a user