Struct HexGridHeuristicProvider
Implements
Namespace: AnyPath.Graphs.HexGrid
Assembly: AnyPath.dll
Syntax
public struct HexGridHeuristicProvider : IHeuristicProvider<HexGridCell>
Constructors
HexGridHeuristicProvider(HexGridType)
Construct a heuristic provider for a hexagonal grid.
Declaration
public HexGridHeuristicProvider(HexGridType gridType)
Parameters
| Type | Name | Description |
|---|---|---|
| HexGridType | gridType | Cell layout of the grid. This value should match the one defined on the HexGrid |
Fields
gridType
The grid type to base the heuristic value on. This should match the type set on the HexGrid itself. Defaults to UnityTileMap (0).
Declaration
public HexGridType gridType
Field Value
| Type | Description |
|---|---|
| HexGridType |
Methods
Heuristic(HexGridCell)
Returns the distance between two hex locations on this grid
Declaration
public float Heuristic(HexGridCell a)
Parameters
| Type | Name | Description |
|---|---|---|
| HexGridCell | a |
Returns
| Type | Description |
|---|---|
| float |
SetGoal(HexGridCell)
Gets called by A* before the algorithm begins, keep track of the goal internally.
Declaration
public void SetGoal(HexGridCell goal)
Parameters
| Type | Name | Description |
|---|---|---|
| HexGridCell | goal |