Interface IGraph<TNode, TSeg>
Defines a graph structure. AnyPath can operate on structs that implement this interface.
Inherited Members
System.IDisposable.Dispose()
Namespace: AnyPath.Native
Assembly: Assembly-CSharp.dll
Syntax
public interface IGraph<TNode, TSeg> : IGraph, INativeDisposable, IDisposable where TNode : struct, IEquatable<TNode> where TSeg : struct
Type Parameters
Name | Description |
---|---|
TNode | The type of nodes the graph contains |
TSeg | The type of segments the resulting path contains |
Methods
| Improve this Doc View SourceCollect(TNode, ref EdgeCollector<TNode, TSeg>)
Implement adding all nodes that are connected to the input location with their segments.
Declaration
void Collect(TNode node, ref EdgeCollector<TNode, TSeg> collector)
Parameters
Type | Name | Description |
---|---|---|
TNode | node | The input node |
EdgeCollector<TNode, TSeg> | collector | Add the connected nodes along with their segments. |
Heuristic(TNode, TNode)
Implement the heuristic function that estimes the cost of travelling from A to B on the graph. It is stronly recommended that the heuristic is admissable, that is, it does not overestimate the cost.
Declaration
float Heuristic(TNode a, TNode b)
Parameters
Type | Name | Description |
---|---|---|
TNode | a | Node A |
TNode | b | Node B |
Returns
Type | Description |
---|---|
System.Single | The minimum cost to travel from a to b |