PathFindingApi class
API responsible for finding paths using A* and moving the component through them.
The parent component must have a Movement mixin.
Constructors
- PathFindingApi(Movement _comp)
Properties
Methods
-
dispose(
) → void - Cleans up path line component when the component is removed.
-
getPathToPosition(
Vector2 position, {List< GameComponent> ? ignoreCollisions}) → List<Vector2> -
Returns the path to
positionwithout moving the component. -
moveAlongThePath(
List< Vector2> path, {VoidCallback? onFinish}) → void -
Makes the component follow a previously calculated
path. -
moveToPosition(
Vector2 position, {List< GameComponent> ? ignoreCollisions, VoidCallback? onFinish}) → Future<List< Vector2> > -
Moves the component to
positionusing A* path finding. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onFinishListener(
PathFindingFinishCallback callback) → void - Registers a callback fired when the component reaches the path end.
-
render(
Canvas canvas) → void - Renders debug barriers if enabled.
-
setup(
{bool? linePathEnabled, Color? pathLineColor, Color? barriersCalculatedColor, double pathLineStrokeWidth = 4, bool showBarriersCalculated = false, bool useOnlyVisibleBarriers = true, bool useAreaBetweenPlayerAndTarget = false, bool gridSizeIsCollisionSize = false, bool withDiagonal = true, double factorInflateFindArea = 2}) → void - Sets up path finding visuals and behavior.
-
stop(
) → void - Stops following the current path.
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
double dt) → void - Updates path following movement.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited