C# Class Nez.ListPool

simple static class that can be used to pool Lists
ファイルを表示 Open project: lihaochen910/UnityGoapAIDemo

Public Methods

Method Description
clearCache ( ) : void

clears out the cache

free ( List obj ) : void

pushes an item back on the stack

obtain ( ) : List

pops an item off the stack if available creating a new item as necessary

trimCache ( int cacheCount ) : void

trims the cache down to cacheCount items

warmCache ( int cacheCount ) : void

warms up the cache filling it with a max of cacheCount objects

Method Details

clearCache() public static method

clears out the cache
public static clearCache ( ) : void
return void

free() public static method

pushes an item back on the stack
public static free ( List obj ) : void
obj List Object.
return void

obtain() public static method

pops an item off the stack if available creating a new item as necessary
public static obtain ( ) : List
return List

trimCache() public static method

trims the cache down to cacheCount items
public static trimCache ( int cacheCount ) : void
cacheCount int Cache count.
return void

warmCache() public static method

warms up the cache filling it with a max of cacheCount objects
public static warmCache ( int cacheCount ) : void
cacheCount int new cache count
return void