public XPathAxisIterator(XPathSimpleIterator iterator, NodeTest test) : base(iterator) { this.iterator = iterator; this.test = test; }
public void SetParentAndHCost(NodeTest theParent, NodeTest theEnd) //setting parent gcost and hcost { NodeSearchedThrough = true; _ParentNode = theParent; _XValue = theEnd.PosX - PosX; _YValue = theEnd.PosY - PosY; if (_XValue < 0) { _XValue *= -1; } if (_YValue < 0) { _YValue *= -1; } _HCost = _XValue + _YValue; // GCost = (1 * 1.4f) + _ParentNode.GCost; if (theParent.PosX - PosX + theParent.PosY - PosY == 0 || theParent.PosX - PosX + theParent.PosY - PosY == 2 || theParent.PosX - PosX + theParent.PosY - PosY == -2) { GCost = (1 * 1.4f) + _ParentNode.GCost; } else { GCost = (1 * 1f) + _ParentNode.GCost; } FCost = _HCost + GCost; }
public void Create_ProcessingInstruction_NoParam() { NodeTest test = NodeTest.Create("processing-instruction()"); Assert.AreEqual(typeof(NodeTestProcessingInstruction), test.GetType()); Assert.AreEqual("processing-instruction()", test.ToString()); }
// public interface to traversal.. public List <ssBVHNode <GO> > traverse(NodeTest hitTest) { var hits = new List <ssBVHNode <GO> >(); this._traverse(rootBVH, hitTest, hits); return(hits); }
public void Create_Wildcard_Ns0() { NodeTest test = NodeTest.Create("ns0:*"); Assert.AreEqual(typeof(NodeTestWildcard), test.GetType()); Assert.AreEqual("ns0:*", test.ToString()); }
public XPathAxisIterator(XPathAxisIterator copy) : base(copy) { iterator = (XPathSimpleIterator)(copy.iterator.Clone()); test = copy.test; pos = copy.pos; }
public void Create_Text() { NodeTest test = NodeTest.Create("text()"); Assert.AreEqual("text()", test.ToString()); Assert.AreEqual(NodeTestNodeType.Text, test); }
public void Create_Node() { NodeTest test = NodeTest.Create("node()"); Assert.AreEqual("node()", test.ToString()); Assert.AreEqual(NodeTestNodeType.Node, test); }
public void Create_Comment() { NodeTest test = NodeTest.Create("comment()"); Assert.AreEqual("comment()", test.ToString()); Assert.AreEqual(NodeTestNodeType.Comment, test); }
// public interface to traversal.. public List <ssBVHNode <T> > Query(NodeTest hitTest) { var hits = new List <ssBVHNode <T> >(); _query(RootBVH, hitTest, hits); return(hits); }
public void MapFromToTest() { var foo = new FooTest { Endereco = "Rua 1", Nome = "Foo1", Telefone = "11999999999" }; var node = new NodeTest { Tipo = "Admin", Nome = "Foo1", Telefone = "11999999999" }; var fooFromNode = new FooTest(); fooFromNode.MapFromTo(node); var nodeFromFoo = new NodeTest(); nodeFromFoo.MapFromTo(foo); Assert.AreEqual(node.Nome, fooFromNode.Nome); Assert.AreEqual(node.Telefone, fooFromNode.Telefone); Assert.AreEqual(null, fooFromNode.Endereco); Assert.AreEqual(foo.Nome, nodeFromFoo.Nome); Assert.AreEqual(foo.Telefone, nodeFromFoo.Telefone); Assert.AreEqual(null, nodeFromFoo.Tipo); nodeFromFoo.MapFromTo(null); Assert.AreEqual(foo.Nome, nodeFromFoo.Nome); Assert.AreEqual(foo.Telefone, nodeFromFoo.Telefone); Assert.AreEqual(null, nodeFromFoo.Tipo); }
public void OnValidate() { //Debug.Log ("Ran"); NodeTest myTarget = (NodeTest)target; myTarget.nodeMan = GameObject.FindGameObjectWithTag("LvlManager").GetComponent <TEST_nodeManager>(); /* if (GUILayout.Button ("Set Start")) { * * myTarget.pathpoints[0].position= myTarget.transform.position; * } * if(GUILayout.Button("Add New Point In End")) * { * GameObject go = new GameObject (); * go.transform.position = myTarget.pathpoints [myTarget.pathpoints.Count - 1].position + Vector3.right; * go.name="wayPoint"; * go.transform.SetParent (myTarget.transform.parent); * * myTarget.pathpoints.Add(go.transform); * Selection.activeGameObject = go; * }*/ }
public void Create_NamedNode_Ns0() { NodeTest test = NodeTest.Create("ns0:ICSMXML"); Assert.AreEqual(typeof(NodeTestNamedNode), test.GetType()); Assert.AreEqual("ns0:ICSMXML", test.ToString()); }
private ChildOverDescendantsNodeIterator(ChildOverDescendantsNodeIterator src) { context = src.context; nodeTest = src.nodeTest; iter = src.iter.Clone(); lastTest = src.lastTest; kind = src.kind; }
void UpdateCurrent(int i) { if (curNode.neiborghs [i] != null) { curNode = curNode.neiborghs [i]; playerdestiny = curNode.transform.position; } }
private ChildOverDescendantsNodeIterator(ChildOverDescendantsNodeIterator src) { _context = src._context; _nodeTest = src._nodeTest; _iterator = src._iterator.Clone(); _lastTest = src._lastTest; _kind = src._kind; }
internal bool ft; // first time public Step() { nextS = prevS = (Step)null; p = pt = null; nt = null; ft = true; position = 1; }
public LocationPathPattern(ExprFilter filter) { this.filter = filter; while (!(filter.expr is NodeTest)) { filter = (ExprFilter)filter.expr; } this.nodeTest = (NodeTest)filter.expr; }
public LocationPathPattern (ExprFilter filter) { this.filter = filter; while (! (filter.expr is NodeTest)) filter = (ExprFilter)filter.expr; this.nodeTest = (NodeTest)filter.expr; }
public async Task TestAdd() { BinaryNode node = new BinaryNode(Guid.NewGuid(), null, new BinaryOpParameters { Lhs = "3", Operation = BinaryOperation.Add, Rhs = "7" }, new TestCompiler()); Assert.AreEqual(10, await NodeTest.Execute(node)); }
public Step() { nextS = prevS = (Step)null; p = pt = null; nt = null; ft = true; //position = 1; hasPredicate = false; nt_eval = false; out_of_range = false; }
void GoToNext() { foreach (var item in curNode.neiborghs) { if (item != null && item != cameFrom) { curNode = item; playerdestiny = curNode.transform.position; } } }
public async Task TestAddVariable() { BinaryNode node = new BinaryNode(Guid.NewGuid(), null, new BinaryOpParameters { Lhs = "lhs", Operation = BinaryOperation.Add, Rhs = "rhs" }, new TestCompiler()); Assert.AreEqual(10, await NodeTest.Execute(node, new Dictionary <string, object> { ["lhs"] = 6, ["rhs"] = 4 })); }
void UpdateCurrent(int i) { cameFrom = curNode; if (curNode.neiborghs [i] != null) { curNode = curNode.neiborghs [i]; playerdestiny = curNode.transform.position; Debug.Log("going"); } Debug.Log("not going"); }
// internal functional traversal... private void _traverse(ssBVHNode <GO> curNode, NodeTest hitTest, List <ssBVHNode <GO> > hitlist) { if (curNode == null) { return; } if (hitTest(curNode.box)) { hitlist.Add(curNode); _traverse(curNode.left, hitTest, hitlist); _traverse(curNode.right, hitTest, hitlist); } }
public ChildOverDescendantsNodeIterator(XPath2Context context, NodeTest[] nodeTest, XPath2NodeIterator iter) { this.context = context; this.nodeTest = nodeTest; this.iter = iter; lastTest = nodeTest[nodeTest.Length - 1]; kind = XPathNodeType.All; if (lastTest.nameTest != null || (lastTest.typeTest != null && lastTest.typeTest.GetNodeKind() == XPathNodeType.Element)) { kind = XPathNodeType.Element; } }
public ChildOverDescendantsNodeIterator(XPath2Context context, NodeTest[] nodeTest, XPath2NodeIterator iterator) { _context = context; _nodeTest = nodeTest; _iterator = iterator; _lastTest = nodeTest[nodeTest.Length - 1]; _kind = XPathNodeType.All; if (_lastTest.NameTest != null || (_lastTest.TypeTest != null && _lastTest.TypeTest.GetNodeKind() == XPathNodeType.Element)) { _kind = XPathNodeType.Element; } }
// internal functional traversal... private static void _query(ssBVHNode <T> curNode, NodeTest hitTest, ICollection <ssBVHNode <T> > hitlist) { if (curNode == null) { return; } if (hitTest(curNode.Bounds)) { hitlist.Add(curNode); _query(curNode.Left, hitTest, hitlist); _query(curNode.Right, hitTest, hitlist); } }
public void SetNewParent(NodeTest theParent) //Adding the parent GCost to this nodes gcost and adding the distance the parent had to travel to this node gcost { _ParentNode = theParent; if (theParent.PosX - PosX + theParent.PosY - PosY == 0 || theParent.PosX - PosX + theParent.PosY - PosY == 2 || theParent.PosX - PosX + theParent.PosY - PosY == -2) { GCost = (1 * 1.4f) + _ParentNode.GCost; } else { GCost = (1 * 1f) + _ParentNode.GCost; // Debug.Log (PathfindingNodeID[MapCollision]); } FCost = _HCost + GCost; }
void CalcGscore(NodeTest currentNode, NodeTest neighbor) { var tentativeG = currentNode.gscore + 10; if (neighbor.gscore > tentativeG) { neighbor.gscore = tentativeG; neighbor.Parent = currentNode; } else { neighbor.gscore = tentativeG; neighbor.Parent = currentNode; } }
void sortOpen(List <NodeTest> list) { for (int i = 0; i < list.Count; i++) { for (int j = 0; j < list.Count; j++) { if (list[i].fscore < list[j].fscore) { NodeTest temp = list[i]; list[i] = list[j]; list[j] = temp; } } } }
internal XPathNodeIterator SelectTest (NodeTest test) { return test.EvaluateNodeSet (new NullIterator (this)); }
public LocationPathPattern (NodeTest nodeTest) { this.nodeTest = nodeTest; }
public bool TestNodes(NodeTest test, object nScope, bool fParentChainsMustGoToRoot) { return (bool)this._weasel.Invoke("TestNodes", new object[] { test, nScope, fParentChainsMustGoToRoot }); }
//string name, ns; //XPathNodeType matchType; public AxisIterator (BaseIterator iter, NodeTest test) : base (iter.NamespaceManager) { _iter = iter; _test = test; //test.GetInfo (out name, out ns, out matchType, NamespaceManager); // if (name != null) // name = Current.NameTable.Add (name); // if (ns != null) // ns = Current.NameTable.Add (ns); }
private AxisIterator (AxisIterator other) : base (other) { _iter = (BaseIterator) other._iter.Clone (); _test = other._test; //name = other.name; //ns = other.ns; //matchType = other.matchType; }