Skip to content

PoolingSystem

Matt Dean edited this page Jan 15, 2020 · 1 revision

The main static class for kPooling. This class defines all the API required for creating and managing pools, as well as getting and returning instances.

Public Methods

HasPool

return bool

Tests for existing Pool of type T with given key.

Argument Type Description
key object Unique identifier for Pool.

CreatePool

return void

Creates a new Pool of type T.

Argument Type Description
key object Unique identifier for Pool.
source T The object to base instances from.
instanceCount int Amount of instances to create.

DestroyPool

return void

Destroys existing Pool of type T with given key.

Argument Type Description
key object Unique identifier for Pool.

TryGetInstance

return bool

Tries to get an Instance of type T from Pool with given key.

Argument Type Description
key object Unique identifier for Pool.
source out T Returned instance.

ReturnInstance

return void

Returns an Instance of type T to Pool with given key.

Argument Type Description
key object Unique identifier for Pool.
source T Instance to return.

Clone this wiki locally