Click or drag to resize

PoolT Class

An object pool that can recycle objects of the type T. If the type implements IPoolable they will be notified when they're spawned and despawned.
Inheritance Hierarchy
SystemObject
  Archon.SwissArmyLib.PoolingPoolT
    Archon.SwissArmyLib.PoolingGameObjectPoolT

Namespace:  Archon.SwissArmyLib.Pooling
Assembly:  Archon.SwissArmyLib (in Archon.SwissArmyLib.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class Pool<T> : IPool<T>, TellMeWhenITimerCallback
where T : class
Request Example View Source

Type Parameters

T
The type of objects this object pool should contain.

The PoolT type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyFreeCount
Gets the current amount of free instances in the pool.
Top
Methods
  NameDescription
Public methodCancelDespawn
Cancels a pending timed despawn.
Public methodDespawn(T)
Despawns an object, adding it back to the pool.
Public methodDespawn(T, Single, Boolean)
Despawns an object after a delay.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnDespawned
Called when an object has been despawned and placed back in the pool.
Protected methodOnSpawned
Called when an object has been spawned and removed from the pool.
Public methodPrewarm
Fills the pool with objects so that it contains the specified amount of objects. If it already contains the specified amount or more, nothing will be done.
Public methodSpawn
Spawns a recycled object if there's one available, otherwise creates a new instance.
Protected methodSpawnInternal
Recycles or creates a object if there's one available without calling OnSpawned(T).
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Protected fieldFree
Contains the items ready to be reused.
Top
See Also