private AbstractNode AnalysisNode(NodeValue nodeValue, IConditionCheck iConditionCheck)
        {
            AbstractNode nodeBase = BehaviorConfigNode.Instance.GetNode(nodeValue.identificationName);

            if (nodeValue.NodeType == (int)NODE_TYPE.CONDITION)  // 条件节点
            {
                NodeCondition condition = (NodeCondition)nodeBase;
                condition.SetData(nodeValue.parameterList, nodeValue.conditionGroupList);
                condition.SetConditionCheck(iConditionCheck);
            }
            else if (nodeValue.NodeType == (int)NODE_TYPE.ACTION)
            {
                NodeAction action = (NodeAction)nodeBase;
                action.SetParameters(nodeValue.parameterList);
            }
            else if (nodeValue.NodeType == (int)NODE_TYPE.IF_JUDEG_PARALLEL || nodeValue.NodeType == (int)NODE_TYPE.IF_JUDEG_SEQUENCE)
            {
                NodeIfJudge ifJudge = (NodeIfJudge)nodeBase;
                ifJudge.SetData(nodeValue.ifJudgeDataList);
                ifJudge.SetDefaultResult((ResultType)nodeValue.defaultResult);
            }
            else if (nodeValue.NodeType == (int)NODE_TYPE.DECORATOR_REPEAT)
            {
                NodeDecoratorRepeat repeat = (NodeDecoratorRepeat)nodeBase;
                repeat.SetRepeatCount(nodeValue.repeatTimes);
            }

            return(nodeBase);
        }
Ejemplo n.º 2
0
        public NodeDecoratorRepeat GetRepeat(NodeValue nodeValue)
        {
            NodeDecoratorRepeat repeat = new NodeDecoratorRepeat();

            repeat.SetRepeatCount(nodeValue.repeatTimes);
            return(repeat);
        }