Esempio n. 1
0
    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());
        }
    }
Esempio n. 2
0
    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());
        }
    }
Esempio n. 3
0
    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)));
            }
        }
    }
Esempio n. 4
0
 public void Start(Vector2 location)
 {
     nextNodes.Enqueue(new PathfindingSearchNode(grid.CellAt(location), location, null, 0.0f));
 }