Search Results for

    Show / Hide Table of Contents

    Class ManagedPools

    A managed pooling system implementation primarily meant for the object oriented patterns, based on the C# base object.

    Inheritance
    System.Object
    ManagedPools
    Namespace: GDX.Collections.Pooling
    Syntax
    [VisualScriptingCompatible((short)1)]
    public static class ManagedPools

    Methods

    | Improve this Doc View Source

    GetNextPoolKey()

    Get the next available pool key.

    Declaration
    public static uint GetNextPoolKey()
    Returns
    Type Description
    System.UInt32

    A unique pool identifying key.

    Remarks

    Increments the previously issued stored value, and returns the new value.

    | Improve this Doc View Source

    GetPool(UInt32)

    Get a registered IManagedPool based on its key.

    Declaration
    public static IManagedPool GetPool(uint key)
    Parameters
    Type Name Description
    System.UInt32 key

    The unique key to use when looking for the IManagedPool.

    Returns
    Type Description
    IManagedPool

    An IManagedPool identified by the provided key.

    | Improve this Doc View Source

    GetPool<T>(UInt32)

    Get a registered IManagedPool based on its key.

    Declaration
    public static T GetPool<T>(uint key)
    Parameters
    Type Name Description
    System.UInt32 key

    The unique key to use when looking for the IManagedPool.

    Returns
    Type Description
    T

    A type casted pool identified by the provided key.

    Type Parameters
    Name Description
    T

    The type of the pool, used to cast the return pool

    | Improve this Doc View Source

    GetPoolWithContainsCheck(UInt32)

    Get a registered IManagedPool based on its key, first checking if it is registered.

    Declaration
    public static IManagedPool GetPoolWithContainsCheck(uint key)
    Parameters
    Type Name Description
    System.UInt32 key

    The unique key to use when looking for the IManagedPool.

    Returns
    Type Description
    IManagedPool

    An IManagedPool identified by the provided key, null if not found.

    | Improve this Doc View Source

    GetPoolWithContainsCheck<T>(UInt32)

    Get a registered IManagedPool based on its key, first checking if it is registered.

    Declaration
    public static T GetPoolWithContainsCheck<T>(uint key)
        where T : class
    Parameters
    Type Name Description
    System.UInt32 key

    The unique key to use when looking for the IManagedPool.

    Returns
    Type Description
    T

    A type casted pool identified by the provided key, null if not found.

    Type Parameters
    Name Description
    T

    The type of the pool, used to cast the return pool

    | Improve this Doc View Source

    HasPool(UInt32)

    Is an IManagedPool registered with the provided key?

    Declaration
    public static bool HasPool(uint key)
    Parameters
    Type Name Description
    System.UInt32 key

    A unique pool key

    Returns
    Type Description
    System.Boolean

    true if a pool is found registered with this system, false otherwise.

    | Improve this Doc View Source

    Register(IManagedPool)

    Register a IManagedPool with the global management system.

    Declaration
    public static void Register(IManagedPool managedPool)
    Parameters
    Type Name Description
    IManagedPool managedPool

    Target IManagedPool

    | Improve this Doc View Source

    ReturnAll(Boolean)

    Attempts to return all spawned items to their original IManagedPools.

    Declaration
    public static void ReturnAll(bool shouldShrink = true)
    Parameters
    Type Name Description
    System.Boolean shouldShrink

    Should the pool be shrunk (destroying created items) to its original set minimum size?

    | Improve this Doc View Source

    TearDown(Boolean)

    Execute TearDown() (destroying contents) on all registered IManagedPool which have been flagged to accept it, evaluated by IsAllowedManagedTearDown().

    Declaration
    public static void TearDown(bool forceAll = false)
    Parameters
    Type Name Description
    System.Boolean forceAll

    Execute TearDown() regardless of the IsAllowedManagedTearDown() response.

    Remarks

    This will unregister the IManagedPool itself as well.

    | Improve this Doc View Source

    TryGetFirstPool(Object, out IManagedPool)

    Attempt to get an IManagedPool based on the baseObject.

    Declaration
    public static bool TryGetFirstPool(object baseObject, out IManagedPool pool)
    Parameters
    Type Name Description
    System.Object baseObject

    The System.Object which was used to create the pool.

    IManagedPool pool

    The first found IManagedPool created with baseObject.

    Returns
    Type Description
    System.Boolean

    true/false if an IManagedPool was found.

    | Improve this Doc View Source

    Unregister(IManagedPool)

    Unregister a IManagedPool from with the management system.

    Declaration
    public static void Unregister(IManagedPool managedPool)
    Parameters
    Type Name Description
    IManagedPool managedPool

    Target IManagedPool

    • Improve this Doc
    • View Source
    In This Article
    Back to top Built on 2024-01-01 against 1f69a68.
    Generated by Dox+DocFX.