Package-level declarations

Types

Link copied to clipboard

A supplier that provides the cost of traveling between two cells in a juxtaposition. This will not calculate the cost of a total path, but only the cost of traveling between two cells. The cost is represented as an integer, where a higher value means a higher cost. The cost should be positive and non-negative.

Link copied to clipboard
interface Path : Comparable<Path>

A path is a list of cells that are connected to each other and walkable entirely. An object always consists of at least one cell.

Link copied to clipboard
Link copied to clipboard
class SimplePath(val start: Cell, val currentCost: Double, currPath: List<Cell>) : Path

Functions

Link copied to clipboard

Finds a path from the start location to the end location using the specified algorithm and cost supplier.

Link copied to clipboard

Finds a path from the start cell (this) to the end cell using the specified algorithm and cost supplier.

Link copied to clipboard
fun Locatable.isAdjacentTo(other: Locatable, includeDiagonal: Boolean = false): Boolean

Checks whether this locatable is adjacent to the other locatable. If includeDiagonal is true, the method will also return true if the locatables are diagonal to each other.

fun Location.isAdjacentTo(other: Location, includeDiagonal: Boolean = false): Boolean

Checks whether this location is adjacent to the other location. If includeDiagonal is true, the method will also return true if the locations are diagonal to each other.

Link copied to clipboard
fun Cell.path(): Path

Creates a new path that only contains the specified cell. The path has a length of 0. It starts and ends at the specified cell.