Struct SquareGridHeuristicProviderManhattanDistance
Heuristic provider for the SquareGrid that only calculates manhattan distance. This is the most performant way if your grid only supports four movement directions. Do not use when the grid type is set to EightNeighbours, use SquareGridHeuristicProvider or
Implements
Namespace: AnyPath.Graphs.SquareGrid
Assembly: AnyPath.dll
Syntax
public struct SquareGridHeuristicProviderManhattanDistance : IHeuristicProvider<SquareGridCell>
Methods
Heuristic(SquareGridCell)
Returns the travel distance between two cells on the grid.
Declaration
public float Heuristic(SquareGridCell a)
Parameters
| Type | Name | Description |
|---|---|---|
| SquareGridCell | a |
Returns
| Type | Description |
|---|---|
| float |
SetGoal(SquareGridCell)
Gets called by A* before the algorithm begins, keep track of the goal internally.
Declaration
public void SetGoal(SquareGridCell goal)
Parameters
| Type | Name | Description |
|---|---|---|
| SquareGridCell | goal |