Struct Memory<TNode>
Structure containing multiple native containers that the A* algorithm uses, like a priority queue and hashmaps. Consider this the "working memory" of the algorithm.
Namespace: AnyPath.Native.Util
Assembly: Assembly-CSharp.dll
Syntax
public struct Memory<TNode>
where TNode : struct, IEquatable<TNode>
Type Parameters
Name | Description |
---|---|
TNode | The type of nodes |
Constructors
| Improve this Doc View SourceMemory(Int32, Allocator)
Constructs a memory struct.
Declaration
public Memory(int initialCapacity, Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | initialCapacity | Initial capacity of the came from hashmap |
Unity.Collections.Allocator | allocator | Unity allocator to use |
Fields
| Improve this Doc View SourcemaxExpand
The maximum number of nodes A* may expand into before "giving up". This can provide as an upper bound for targets that are unreachable, reducing computation time because the algorithm will have to search the entire graph before knowing for certain that a target is unreachable.
Declaration
public int maxExpand
Field Value
Type | Description |
---|---|
System.Int32 |
Properties
| Improve this Doc View SourceIsCreated
Returns wether the native containers inside this structure were allocated
Declaration
public readonly bool IsCreated { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceDebugGetAllExpansion(Allocator)
Returns the key-value pairs of all nodes and segments A* expanded too since the last usage
Declaration
public NativeKeyValueArrays<TNode, Memory<TNode>.CameFrom> DebugGetAllExpansion(Allocator allocator)
Parameters
Type | Name | Description |
---|---|---|
Unity.Collections.Allocator | allocator |
Returns
Type | Description |
---|---|
Unity.Collections.NativeKeyValueArrays<TNode, AnyPath.Native.Util.Memory.CameFrom<>> |
Dispose()
Dispose this memory and all of it's native containers
Declaration
public void Dispose()
Dispose(JobHandle)
Dispose this memory and all of it's native containers
Declaration
public void Dispose(JobHandle inputDeps)
Parameters
Type | Name | Description |
---|---|---|
Unity.Jobs.JobHandle | inputDeps | JobHandle to use as a dependency |
ReconstructNodes(TNode, TNode, Boolean)
Declaration
public void ReconstructNodes(TNode start, TNode goal, bool insertQueryStart)
Parameters
Type | Name | Description |
---|---|---|
TNode | start | |
TNode | goal | |
System.Boolean | insertQueryStart |