public void PathFindingSimplePasses() { var grid = new Grid(10, 10); var pathFinder = new PathFinder(); var start = new Point(1, 1); var end = new Point(4, 4); var path = grid.FindPath(pathFinder, start, end); Assert.AreEqual(start, path.First()); Assert.AreEqual(end, path.Last()); }
public void Render() { // Reset color foreach (var entry in items) { entry.Value.SetColor(GridItem.Selected.Nothing); } foreach (var node in grid.FindPath(pathFinder, from, to)) { GridItem item = null; if (!this.items.TryGetValue(node.point, out item)) { throw new Exception("WTF!"); } item.SetColor(GridItem.Selected.Path); } }