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);
        }
Esempio n. 2
0
        private NodeIfJudge GetIfJudge(NodeValue nodeValue)
        {
            NodeIfJudge ifJudge = new NodeIfJudge();

            ifJudge.SetData(nodeValue.ifJudgeDataList);
            return(ifJudge);
        }