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); }
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"); }
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(); }
public ORBuilder(string inputName) { Node = new ORNode("OR", inputName); }