Methods
Gets an item from a specific pool.
Name | Type | Attributes | Description |
---|---|---|---|
Class |
PoolItemConstructor<T> |
The constructor of the items in the pool. |
|
data |
unknown |
<optional> |
Optional data to pass to the item's constructor. |
Returns:
Type | Description |
---|---|
T | The item from the pool. |
Gets a specific pool based on the class type.
Name | Type | Description |
---|---|---|
ClassType |
PoolItemConstructor<T> |
The constructor of the items in the pool. |
Returns:
Type | Description |
---|---|
Pool<T> | The pool of the given class type. |
Prepopulates a specific pool with a given number of items.
Name | Type | Description |
---|---|---|
Class |
PoolItemConstructor<T> |
The constructor of the items in the pool. |
total |
number |
The number of items to add to the pool. |
Returns an item to its respective pool.
Name | Type | Description |
---|---|---|
item |
PoolItem |
The item to return to the pool. |
gets the usage stats of each pool in the system
Returns:
Type | Description |
---|---|
Record<string, { free : number, used : number, size : number }> |