A* Pathfinding Project  3.7.2
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
PathPool< T > Class Template Reference

Pools path objects to reduce load on the garbage collector. More...

Detailed Description

Pools path objects to reduce load on the garbage collector.

Type Constraints
T :Path 
T :new() 

Static Public Member Functions

static T GetPath ()
 
static int GetSize ()
 
static int GetTotalCreated ()
 
static void Recycle (T path)
 Recycles a path and puts in the pool.
 
static void Warmup (int count, int length)
 Warms up path, node list and vector list pools.
 

Static Private Member Functions

static PathPool ()
 

Static Private Attributes

static readonly Stack< T > pool
 
static int totalCreated
 

Constructor & Destructor Documentation

static PathPool ( )
staticprivate

Member Function Documentation

static T GetPath ( )
static
static int GetSize ( )
static
static int GetTotalCreated ( )
static
static void Recycle ( path)
static

Recycles a path and puts in the pool.

This function should not be used directly. Instead use the Path.Claim and Path.Release functions.

static void Warmup ( int  count,
int  length 
)
static

Warms up path, node list and vector list pools.

Makes sure there is at least count paths, each with a minimum capacity for paths with length length in the pool. The capacity means that paths shorter or equal to the capacity can be calculated without any large allocations taking place.

Member Data Documentation

readonly Stack<T> pool
staticprivate
int totalCreated
staticprivate

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