Skip to content

FindPathOptions

Defined in: src/modules/pathfinding/pathfinding.ts:8

Inputs to findPath: from/to and a traversable test, plus optional cost, heuristic, neighbors, and maxCost overrides.

optional cost?: (fromX, fromY, toX, toY) => number

Defined in: src/modules/pathfinding/pathfinding.ts:14

Per-edge cost. Defaults to 2 cardinal / 3 diagonal.

number

number

number

number

number


from: PathNode

Defined in: src/modules/pathfinding/pathfinding.ts:9


optional heuristic?: (ax, ay, bx, by) => number

Defined in: src/modules/pathfinding/pathfinding.ts:16

Heuristic estimate (admissible for A* optimality). Defaults to Chebyshev using default cost weights.

number

number

number

number

number


optional maxCost?: number

Defined in: src/modules/pathfinding/pathfinding.ts:11

Abort and return null if accumulated g exceeds this. Defaults to Infinity.


optional neighbors?: (x, y) => Iterable<PathNode>

Defined in: src/modules/pathfinding/pathfinding.ts:18

Iterable of neighbor candidates from (x, y). Defaults to 8-directional.

number

number

Iterable<PathNode>


to: PathNode

Defined in: src/modules/pathfinding/pathfinding.ts:12


traversable: (x, y) => boolean

Defined in: src/modules/pathfinding/pathfinding.ts:20

Returns true if the given tile can be stood on / traversed.

number

number

boolean