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

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

Detailed Description

Pools path objects to reduce load on the garbage collector.

Static Public Member Functions

static T GetPath< T > ()
 Get a path from the pool or create a new one if the pool is empty.
 
static int GetSize (Type type)
 Number of pooled instances of a path of the specified type.
 
static int GetTotalCreated (Type type)
 Total created instances of paths of the specified type.
 
static void Pool (Path path)
 Adds a path to the pool.
 

Static Private Attributes

static readonly Dictionary
< Type, Stack< Path > > 
pool = new Dictionary<Type, Stack<Path> >()
 
static readonly Dictionary
< Type, int > 
totalCreated = new Dictionary<Type, int>()
 

Member Function Documentation

static T GetPath< T > ( )
static

Get a path from the pool or create a new one if the pool is empty.

Type Constraints
T :Path 
T :new() 
static int GetSize ( Type  type)
static

Number of pooled instances of a path of the specified type.

static int GetTotalCreated ( Type  type)
static

Total created instances of paths of the specified type.

static void Pool ( Path  path)
static

Adds a path to the pool.

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

Member Data Documentation

readonly Dictionary<Type, Stack<Path> > pool = new Dictionary<Type, Stack<Path> >()
staticprivate
readonly Dictionary<Type, int> totalCreated = new Dictionary<Type, int>()
staticprivate

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