LevelGraph SetUnreachableAndUpdate 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 void SetUnreachableAndUpdate(
	int index
)
Remarks

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

2 unit tests call DeltaEngine.GameLogic.PathFinding.LevelGraph.SetUnreachableAndUpdate(System.Int32)
[Test]
public void SetUnreachableNodeAndCheck()
{
    const int Index = 0;
    grid3X2.SetUnreachableAndUpdate(Index);
    Assert.IsFalse(grid3X2.AdjacentLinks[1][Index].IsActive);
    Assert.IsFalse(grid3X2.AdjacentLinks[3][Index].IsActive);
    Assert.IsTrue(grid3X2.IsUnreachableNode(0));
}
[Test]
public void MakingNodeReachableEnablesAllConnections()
{
    const int Index = 0;
    grid3X2.SetUnreachableAndUpdate(Index);
    Assert.IsFalse(grid3X2.AdjacentLinks[1][Index].IsActive);
    grid3X2.SetReachableAndUpdate(Index);
    Assert.IsTrue(grid3X2.AdjacentLinks[1][Index].IsActive);
}
See Also