 | AlgorithmsAStarTCell, TPoint Method (IGridTCell, TPoint, TPoint, TPoint) |
Find the shortest path between a start and goal node.
The distance between nodes(as defined by TPoint.DistanceFrom)
are used as the heuristic and actual cost between nodes.In some cases the
result may be unintuitive, and an overload specifying a different
cost should be used.
See AStar<TCell, TPoint>(IGrid<TCell, TPoint>, TPoint, TPoint, Func<TPoint, TPoint, float>, Func<TCell, bool>, Func<TPoint, TPoint, float>)
Namespace:
Gamelogic.Grids
Assembly:
Assembly-CSharp (in Assembly-CSharp.dll) Version: 0.0.0.0
Syntaxpublic static IEnumerable<TPoint> AStar<TCell, TPoint>(
IGrid<TCell, TPoint> grid,
TPoint start,
TPoint goal
)
where TPoint : Object, IGridPoint<TPoint>
Parameters
- grid
- Type: Gamelogic.GridsIGridTCell, TPoint
- start
- Type: TPoint
- goal
- Type: TPoint
Type Parameters
- TCell
- TPoint
Return Value
Type:
IEnumerableTPointThe list of nodes on the path in order.If no path is possible, null is returned.
See Also