public void CheckHorizontalCombine(PathfindingGrid grid) { PathfindingNode test = grid.CellAt(LeftProbePos()); while (test != null && test.area.height == area.height) { test.ReplaceWith(this, grid); area.width += test.area.width; test = grid.CellAt(LeftProbePos()); } }
public void CheckVerticalCombine(PathfindingGrid grid) { PathfindingNode test = grid.CellAt(TopProbePos()); while (test != null && test.area.width == area.width) { test.ReplaceWith(this, grid); area.height += test.area.height; test = grid.CellAt(TopProbePos()); } }
public void FindConnections(PathfindingGrid grid) { foreach (Vector2 pos in AdjacentCells()) { PathfindingNode test = grid.CellAt(pos); if (test != null) { adjacentNodes.Add(new PathfindingEdge(test, Intersection(Area, test.Area))); } } }
public void Start(Vector2 location) { nextNodes.Enqueue(new PathfindingSearchNode(grid.CellAt(location), location, null, 0.0f)); }