Class: PathNode

PathNode

a class for managing path in a star navigation algorithm

new PathNode (props)

create a path node
Name Type Description
props object
Name Type Description
point Grid current position in path
step number current step
destination Grid destination where player wants to be
from Grid where this path connect with, if null this path is a start point

Methods

getDestination ()Grid

get destination where player wants to be
Returns:
Type Description
Grid

getFrom ()PathNode

get where this path connect with
Returns:
Type Description
PathNode

getLocation ()Grid

get this path's grid location
Returns:
Type Description
Grid

getNeighbors ()Array.<PathNode>

get neighbors pathNode according to this path's grid location
Returns:
Type Description
Array.<PathNode>

getStep ()number

get current step
Returns:
Type Description
number

getWeight ()number

get navigation weight on this path
Returns:
Type Description
number

setFrom (point)

set where this path connect with
Name Type Description
point PathNode