Dungeon Architect  17.0.0
SharpNav.NodePool Class Reference

Link all nodes together. Store indices in hash map. More...

Public Member Functions

 NodePool (int maxNodes, int hashSize)
 Initializes a new instance of the NodePool class. More...
 
void Clear ()
 Reset all the data. More...
 
Node FindNode (int id)
 Try to find a node. More...
 
Node GetNode (int id)
 Try to find the node. If it doesn't exist, create a new node. More...
 
int GetNodeIdx (Node node)
 Gets the id of the node. More...
 
Node GetNodeAtIdx (int idx)
 Return a node at a certain index. If index is out-of-bounds, return null. More...
 

Detailed Description

Link all nodes together. Store indices in hash map.

Definition at line 11 of file NodePool.cs.

Constructor & Destructor Documentation

◆ NodePool()

SharpNav.NodePool.NodePool ( int  maxNodes,
int  hashSize 
)

Initializes a new instance of the NodePool class.

Parameters
maxNodesThe maximum number of nodes that can be stored
hashSizeThe maximum number of elements in the hash table

Definition at line 23 of file NodePool.cs.

Member Function Documentation

◆ Clear()

void SharpNav.NodePool.Clear ( )

Reset all the data.

Definition at line 35 of file NodePool.cs.

◆ FindNode()

Node SharpNav.NodePool.FindNode ( int  id)

Try to find a node.

Parameters
idNode's id
Returns
The node, if found. Null, if otherwise.

Definition at line 46 of file NodePool.cs.

◆ GetNode()

Node SharpNav.NodePool.GetNode ( int  id)

Try to find the node. If it doesn't exist, create a new node.

Parameters
idNode's id
Returns
The node

Definition at line 62 of file NodePool.cs.

◆ GetNodeAtIdx()

Node SharpNav.NodePool.GetNodeAtIdx ( int  idx)

Return a node at a certain index. If index is out-of-bounds, return null.

Parameters
idxNode index
Returns

Definition at line 110 of file NodePool.cs.

◆ GetNodeIdx()

int SharpNav.NodePool.GetNodeIdx ( Node  node)

Gets the id of the node.

Parameters
nodeThe node
Returns
The id

Definition at line 91 of file NodePool.cs.


The documentation for this class was generated from the following file: