示例#1
0
        private NodePremise CreatePremise()
        {
            NodePremise genNodePremise(Tree_PremiseNode preNode, NodePremise lastPre)
            {
                NodePremise nodePremise = preNode.GetRuntimePremise(this);

                if (lastPre != null)
                {
                    lastPre.otherPremise = nodePremise;
                }
                return(nodePremise);
            }

            List <Tree_PremiseNode> nodes = NodeHelper.GetNodeOutNodes <Tree_PremiseNode>(Owner, this);

            if (nodes.Count <= 0)
            {
                return(null);
            }
            NodePremise startPremise = null;
            NodePremise premise      = null;

            for (int i = 0; i < nodes.Count; i++)
            {
                if (i == 0)
                {
                    startPremise = genNodePremise(nodes[i], null);
                    premise      = startPremise;
                }
                else
                {
                    Tree_PremiseNode nextPreNode = nodes[i];
                    premise = genNodePremise(nextPreNode, premise);
                }
            }
            return(startPremise);
        }
示例#2
0
 //添加前提
 public void AddOtherPrecondition(NodePremise premise)
 {
     otherPremise = premise;
 }