GAstar.find

IVec2[] find(const(short)[] data, Sz colCount, Sz startRow, Sz startCol, Sz targetRow, Sz targetCol, IVec2[] buffer, short empty = - 1) @safe nothrow @nogc

Finds the shortest path from the start cell to the target cell. The data slice is a row-major grid with colCount columns. Cells equal to empty can be entered. The start cell does not need to be empty. Writes the path to buffer (without the start cell, ending at the target cell) and returns the written part. If buffer is smaller than the path, only the first steps of the path are written. Returns an empty slice when there is no path, when start and target are the same, or when the grid is too big.

IVec2[] find(const(short)[] data, Sz colCount, IVec2 start, IVec2 target, IVec2[] buffer, short empty = - 1) @safe nothrow @nogc

Finds the shortest path from the start cell to the target cell. Positions use x as the column and y as the row.

IVec2[] find(Sz M)(ref GTileMap!M map, Sz startRow, Sz startCol, Sz targetRow, Sz targetCol, IVec2[] buffer, Sz layerId = 0) @safe nothrow @nogc

Finds the shortest path from the start cell to the target cell on the active area of a tile map layer. Tiles equal to the emptyTileId of the map can be entered.

IVec2[] find(Sz M)(ref GTileMap!M map, IVec2 start, IVec2 target, IVec2[] buffer, Sz layerId = 0) @safe nothrow @nogc

Finds the shortest path from the start cell to the target cell on the active area of a tile map layer. Positions use x as the column and y as the row.