Graph GetNode Method Delta Engine Documentation

Namespace: DeltaEngine.GameLogic.PathFinding
Assembly: DeltaEngine.GameLogic.PathFinding (in DeltaEngine.GameLogic.PathFinding.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public GraphNode GetNode(
	int nodeId
)

Return Value

Type: GraphNode
Remarks

Tests: DeltaEngine.GameLogic.PathFinding.Tests.GraphTests
Remarks

Tests: DeltaEngine.GameLogic.PathFinding.Tests.LevelGraphTests
Examples

2 unit tests call DeltaEngine.GameLogic.PathFinding.Graph.GetNode(System.Int32)
[Test]
public void ThrowExceptionISearchedForWrongNode()
{
    Assert.Throws<Graph.InvalidNodeId>(() => graphAsPlusShape.GetNode(-1));
}
[Test]
public void CheckForExistingGraphNodes()
{
    for (int nodeId = 0; nodeId < NumberOfNodesInGraph; nodeId++)
        Assert.IsNotNull(graphAsPlusShape.GetNode(nodeId));
}
Examples

1 unit tests call DeltaEngine.GameLogic.PathFinding.Graph.GetNode(System.Int32)
[Test]
public void CheckGetNodes()
{
    Assert.AreEqual(4, grid3X2.GetNode(1, 1).Id);
}
See Also