ObjectPool
Type parameters
• T extends IObjectPoolItem
Constructors
new ObjectPool()
new ObjectPool<
T
>(classType
,initialSize
,maxSize
):ObjectPool
<T
>
Parameters
• classType
• initialSize: number
= 0
• maxSize: number
= 0
Returns
ObjectPool
<T
>
Source
src/gameobjects/ObjectPool.ts:9
Properties
classType()
classType: (…
args
) =>T
Parameters
• …args: any
[]
Returns
T
Source
src/gameobjects/ObjectPool.ts:10
initialSize
initialSize:
number
=0
Source
src/gameobjects/ObjectPool.ts:11
maxSize
maxSize:
number
=0
Source
src/gameobjects/ObjectPool.ts:12
Methods
clear()
clear(
destroyItems
):void
Parameters
• destroyItems: boolean
= false
Returns
void
Source
src/gameobjects/ObjectPool.ts:42
conditionalRelease()
conditionalRelease(
item
,condition
):void
Parameters
• item: T
• condition
Returns
void
Source
src/gameobjects/ObjectPool.ts:35
get()
get():
T
Returns
T
Source
src/gameobjects/ObjectPool.ts:19
release()
release(
item
):void
Parameters
• item: T
Returns
void