Struct PathResult
ENGINE: Result of a pathfinding request. Contains path and metadata about the search.
public struct PathResult
Fields
NodesExplored
Number of provinces explored during search
public int NodesExplored
Field Value
- int
Path
Path from start to goal (empty if no path found)
public List<ushort> Path
Field Value
- List<ushort>
Status
Status of the pathfinding request
public PathStatus Status
Field Value
TotalCost
Total cost of the path
public FixedPoint64 TotalCost
Field Value
WasCached
Whether the path was retrieved from cache
public bool WasCached
Field Value
- bool
Properties
Length
Number of provinces in the path (0 if no path)
public int Length { get; }
Property Value
- int
Success
True if a valid path was found
public bool Success { get; }
Property Value
- bool
Methods
Error(PathStatus)
public static PathResult Error(PathStatus status)
Parameters
statusPathStatus
Returns
Found(List<ushort>, FixedPoint64, int, bool)
public static PathResult Found(List<ushort> path, FixedPoint64 cost, int nodesExplored, bool cached = false)
Parameters
pathList<ushort>costFixedPoint64nodesExploredintcachedbool
Returns
NotFound(int)
public static PathResult NotFound(int nodesExplored = 0)
Parameters
nodesExploredint
Returns
TrivialPath(ushort)
public static PathResult TrivialPath(ushort province)
Parameters
provinceushort