Class: BreadthFirstFinder

PFBreadthFirstFinder

new BreadthFirstFinder(allowDiagonal)

Breadth-First-Search path finder.

Source:
./src/modules/BreadthFirst.js, line 7
Parameters:
Name Type Description
allowDiagonal boolean Whether diagonal movement is allowed.

Extends

Properties

constructor

The constructor of the instance.

Source:
./src/modules/BreadthFirst.js, line 25

Methods

<protected> _find() → {Array.<[number, number]>}

Find and return the the path.

Source:
./src/modules/BreadthFirst.js, line 34
Returns:
The path, including both start and end positions.
Type
Array.<[number, number]>

<protected> _inspectNodeAt(x, y, px, py)

Push the position into the open list if this position is not in the list. Otherwise, if the position can be accessed with a lower cost from the given parent position, then update its parent and cost

Source:
./src/modules/BreadthFirst.js, line 80
Parameters:
Name Type Description
x number The x coordinate of the position.
y number The y coordinate of the position.
px number The x coordinate of the parent position.
py number The y coordinate of the parent position.

<protected> _inspectSurround(x, y)

Inspect the surrounding nodes of the given position

Source:
./src/modules/BreadthFirst.js, line 99
Parameters:
Name Type Description
x number The x coordinate of the position.
y number The y coordinate of the position.

<protected> _inspectSurroundDiagonal(x, y)

Inspect the surrounding nodes of the given position (including the diagonal ones).

Source:
./src/modules/BreadthFirst.js, line 123
Parameters:
Name Type Description
x number The x coordinate of the position.
y number The y coordinate of the position.