 | AlgorithmsAStarTCell, TPoint Method (IGridTCell, TPoint, TPoint, TPoint, FuncTPoint, TPoint, Single, FuncTCell, Boolean) |
Note: This API is now obsolete.
Find the shortest path between a start and goal node.
The distance between nodes(as defined by TPoint.DistanceFrom)
are used as the actual cost between nodes.In some cases the
result may be unintuitive, and an overload specifying a different
cost should be used.
Using an overload with an appropriate distance function can solve the
issue.
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
Syntax[ObsoleteAttribute("Use the overload instead that allows you to specify the cost in addition to the cost heuristic")]
public static IEnumerable<TPoint> AStar<TCell, TPoint>(
IGrid<TCell, TPoint> grid,
TPoint start,
TPoint goal,
Func<TPoint, TPoint, float> heuristicCostEstimate,
Func<TCell, bool> isAccessible
)
where TPoint : Object, IGridPoint<TPoint>
Parameters
- grid
- Type: Gamelogic.GridsIGridTCell, TPoint
- start
- Type: TPoint
- goal
- Type: TPoint
- heuristicCostEstimate
- Type: SystemFuncTPoint, TPoint, Single
- isAccessible
- Type: SystemFuncTCell, Boolean
Type Parameters
- TCell
- TPoint
Return Value
Type:
IEnumerableTPoint
See Also