Wiki

Clone wiki

RogueSharp / RogueSharp / GoalMap / FindPaths

GoalMapFindPaths Method

Returns a ReadOnlyCollection of Paths representing all of the shortest paths from the specified location to the Goal or Goals determined to have the highest priority This method is useful when there are multiple paths that would all work and we want to have some additional logic to pick one of the best paths The FindPath( int x, int y ) method in the GoalMap class uses this method and then chooses the first path.

Namespace: RogueSharp
Assembly:

Syntax

public ReadOnlyCollection<Path> FindPaths(
    int x,
    int y
)

Parameters

x

Type: SystemInt32
X location of the beginning of the path, starting with 0 as the farthest left

y

Type: SystemInt32
Y location of the beginning of the path, starting with 0 as the top

Return Value

Type: ReadOnlyCollectionPath
A ReadOnlyCollection of Paths representing all of the shortest paths from the specified location to the Goal or Goals determined to have the highest priority

Implements

IGoalMapFindPaths(Int32, Int32)

Exceptions

Exception Condition
PathNotFoundException Thrown when there is not a path from the Source x,y to any Goal or a Goal is not set

See Also

Reference

GoalMap Class
RogueSharp Namespace

[6]: 2014-2016 Faron Bracy

Updated