Advanced
Constructs a new Pool.
The constructor of the items in the pool.
Optional
initialSize: numberThe initial size of the pool.
Gets the number of items in the pool that are free to use without needing to create more.
Gets the number of items in the pool.
Gets the number of items in the pool that are currently in use.
clears the pool - mainly used for debugging!
Gets an item from the pool. Calls the item's init
method if it exists.
If there are no items left in the pool, a new one will be created.
Optional
data: unknownOptional data to pass to the item's constructor.
The item from the pool.
Prepopulates the pool with a given number of items.
The number of items to add to the pool.
Returns an item to the pool. Calls the item's reset
method if it exists.
The item to return to the pool.
A generic class for managing a pool of items.