grid-engine
    Preparing search index...

    Interface PathfindingResult

    Result of a pathfinding algorithm run.

    interface PathfindingResult {
        closestToTarget?: LayerPosition;
        path: LayerPosition[];
        reachedMaxPathLength: boolean;
        steps: number;
    }
    Index

    Properties

    closestToTarget?: LayerPosition

    Only set, if PathfindingOptions.calculateClosestToTarget is set. It will still be set in algorithms where it does not come with a performance penalty (like BFS). If no path could be found, it contains one position that has the closest distance to the target. The distance is either manhattan distance in case of 4 direction mode or Chebyshev distance in case of 8 direction mode.

    Actual shortest path. Contains an empty array if no path has been found.

    reachedMaxPathLength: boolean

    In case that PathfindingOptions.maxPathLength was set, this property indicates that pathfinding stopped because it reached that maximum path lenght.

    steps: number