LevelGraphTests TestAllowingDiagonalPaths Method Delta Engine Documentation

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

public void TestAllowingDiagonalPaths()
Examples

[Test]
public void TestAllowingDiagonalPaths()
{
    var grid = new MockLevelGraph(3, 2);
    Assert.AreEqual(1, grid.AdjacentLinks[0][0].TargetNode);
    Assert.AreEqual(3, grid.AdjacentLinks[0][1].TargetNode);
    Assert.AreEqual(4, grid.AdjacentLinks[0][2].TargetNode);
    Assert.AreEqual(0, grid.AdjacentLinks[1][0].TargetNode);
    Assert.AreEqual(2, grid.AdjacentLinks[1][1].TargetNode);
    Assert.AreEqual(4, grid.AdjacentLinks[1][2].TargetNode);
    Assert.AreEqual(5, grid.AdjacentLinks[1][3].TargetNode);
    Assert.AreEqual(3, grid.AdjacentLinks[1][4].TargetNode);
    Assert.AreEqual(1, grid.AdjacentLinks[2][0].TargetNode);
    Assert.AreEqual(5, grid.AdjacentLinks[2][1].TargetNode);
    Assert.AreEqual(4, grid.AdjacentLinks[2][2].TargetNode);
}
See Also