Namespace AnyPath.Graphs.SquareGrid

A simple square grid structure with support for per tile cost and four or eight neighbours per tile.
Structs
SquareGrid
A 2D-grid where each cell is defined as an int2 Travelling one cell along the map has a cost of 1 + destination cell cost. Travelling diagonally has a cost of sqrt(2) + destination cell cost. Unset cells have a default cost of zero. To make a cell unwalkable, assign it a cost of infinity. This means that every location is walkable by default.
SquareGrid.Enumerator
Struct enumerator that enumerates all cells of a bounded grid. This includes open cells that are not set. This can be used for constructing ALT heuristics.
SquareGridCell
SquareGridHeuristicProvider
Heuristic provider for the SquareGrid that supports both FourNeighbours and EightNeighbours
SquareGridHeuristicProviderEightDirectional
Heuristic provider for the SquareGrid that supports eight directions.
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
Enums
SquareGridType
Specifies how many neighbours every location has. Four neighbours only allows for straight movement. Eight neighbours includes diagonal movement.