示例#1
0
        public int EvaluateORNode(ORNode node, ADTreeContext context)
        {
            int a = node.LeftChild.Accept(this, context) + node.Cost;
            int b = node.RightChild.Accept(this, context) + node.Cost;

            return(a > b ? b : a);
        }
示例#2
0
        public bool EvaluateORNode(ORNode node, ADTreeContext context)
        {
            bool l = node.LeftChild.Accept(this, context);
            bool r = node.RightChild.Accept(this, context);

            return(l || r);
        }
 public ORNode OR()
 {
     if (lexer.GetToken().Id == 21)
     {
         var result = new ORNode(lexer.GetText());
         lexer.NextToken();
         return(result);
     }
     throw new ParserException("Got unxpected token from lexer");
 }
示例#4
0
        public override void OnClick(Node source, Vector2 mousePosition)
        {
            ORNode node = source as ORNode;

            NodeEditorUtility.AddNewNode(graph.editorData, null, null, mousePositionOnCanvas, (MultiORNode n) => {
                n.targets[0] = node.targetA;
                n.targets[1] = node.targetB;
                n.editorRect = node.editorRect;
                RefactorUtility.RetargetValueNode(node, n);
            });
            NodeEditorUtility.RemoveNode(graph.editorData, node);
            graph.Refresh();
        }
示例#5
0
 public ORBuilder(string inputName)
 {
     Node = new ORNode("OR", inputName);
 }