AStarFinder class

A* path-finder. based upon https://github.com/bgrins/javascript-astar @constructor @param {object} opt @param {boolean} opt.allowDiagonal Whether diagonal movement is allowed. @param {boolean} opt.dontCrossCorners Disallow diagonal movement touching block corners. @param {function} opt.heuristic Heuristic function to estimate the distance (defaults to manhattan). @param {integer} opt.weight Weight to apply to the heuristic to allow for suboptimal paths, in order to speed up the search.

Constructors

AStarFinder({bool allowDiagonal = false, bool dontCrossCorners = false, HeuristicFn? heuristic, int weight = 1})

Properties

allowDiagonal bool
getter/setter pair
dontCrossCorners bool
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
heuristic HeuristicFn
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
weight int
getter/setter pair

Methods

findPath(dynamic startX, dynamic startY, dynamic endX, dynamic endY, Grid grid) → dynamic
Find and return the the path. @return {Array.<number, number>} The path, including both start and end positions.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited