| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System.Collections.Generic;
- using IwbZero.Expr;
- using WeEngine.Enum;
- namespace WeEngine.Functions
- {
- /// <summary>
- /// 等待节点
- /// </summary>
- public class FunWaitNode : RunTimeBase, IFunction
- {
- public string Invoke(ExprObject exprObj)
- {
- ExprObject child = exprObj.GetChild(0), child2 = exprObj.GetChild(2), child3 = exprObj.GetChild(4);
- GetPackage(child.Expr);
- if (child3==null)
- {
- return "FALSE";
- }
- var waitNode = Rp.GetNodeByPath(child3.Expr);
- if (waitNode == null)
- {
- return "FALSE";
- }
- if (waitNode.NodeState == NodeState.RunEnd || waitNode.NodeState == NodeState.Complete)
- {
- var child4 = exprObj.GetChild(6);
- return child4 != null ? ExprModule.Evaluate(child4.Expr) : "TRUE";
- }
- var node = Rp.GetNodeByPath(child2.Expr);
- if (Rp.WaitForRunNode.ContainsKey(waitNode.Id))
- {
- Rp.WaitForRunNode[waitNode.Id].Add(node.Id);
- }
- else
- {
- Rp.WaitForRunNode[waitNode.Id] = new List<string>() {node.Id};
- }
- return "FALSE";
- }
- }
- }
|