Table of Contents

Struct PathResult

Namespace
Core.Systems
Assembly
Core.dll

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

PathStatus

TotalCost

Total cost of the path

public FixedPoint64 TotalCost

Field Value

FixedPoint64

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

status PathStatus

Returns

PathResult

Found(List<ushort>, FixedPoint64, int, bool)

public static PathResult Found(List<ushort> path, FixedPoint64 cost, int nodesExplored, bool cached = false)

Parameters

path List<ushort>
cost FixedPoint64
nodesExplored int
cached bool

Returns

PathResult

NotFound(int)

public static PathResult NotFound(int nodesExplored = 0)

Parameters

nodesExplored int

Returns

PathResult

TrivialPath(ushort)

public static PathResult TrivialPath(ushort province)

Parameters

province ushort

Returns

PathResult