forkTo

abstract fun forkTo(cell: Cell, at: Int = -1, cost: CellTravelCostSupplier = CellTravelCostSupplier.None): Path(source)

Forks the path at the given position and returns a new path that starts at the same start as this path and includes this path's last cell before at at the second last index and at the last index, the given cell. If a new cell is added onto this path, it will not appear in the forked path's cell listing.

Return

a new forked path from included in this path to cell

Parameters

cell

the cell to which this path should be forked to

at

the index position at which this path should be forked; if this is negative, the path will be forked at the last element

cost

the cost of traveling from the cell at forking of this path to cell

Throws

if cell is not a neighbor of the cell at at