Class Path<TSeg>
The result of a managed path finding request.
Namespace: AnyPath.Managed.Results
Assembly: AnyPath.dll
Syntax
public class Path<TSeg> : IReadOnlyList<TSeg>, IReadOnlyCollection<TSeg>, IEnumerable<TSeg>, IEnumerable where TSeg : unmanaged
Type Parameters
| Name | Description |
|---|---|
| TSeg | The type of edges contained in the path |
Properties
Cost
The total cost of the path
Declaration
public float Cost { get; }
Property Value
| Type | Description |
|---|---|
| float |
HasPath
Indicates wether a path was found
Declaration
public bool HasPath { get; }
Property Value
| Type | Description |
|---|---|
| bool |
this[int]
Indexes the edges from the start to the end of the path.
Declaration
public TSeg this[int index] { get; }
Parameters
| Type | Name | Description |
|---|---|---|
| int | index | Index of the edge |
Property Value
| Type | Description |
|---|---|
| TSeg |
Length
Amount of segments contained in this path
Declaration
public int Length { get; }
Property Value
| Type | Description |
|---|---|
| int |
Methods
GetEnumerator()
Declaration
public ArraySliceEnumerator<TSeg> GetEnumerator()
Returns
| Type | Description |
|---|---|
| ArraySliceEnumerator<TSeg> |
Hydrate(bool, TSeg[], float)
Constructs a path result using the supplied array and cost
Declaration
protected void Hydrate(bool hasPath, TSeg[] segments, float cost)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | hasPath | The value of hasPath, if false, supply an empty array of segments |
| TSeg[] | segments | The array that is supplied is used directly (no copy is made) |
| float | cost | Total cost of the path |