Search Results for

    Show / Hide Table of Contents

    Interface IManagedPool

    An interface describing the functionality needed for a pool to be understood by ManagedPools.

    Namespace: GDX.Collections.Pooling
    Syntax
    public interface IManagedPool

    Methods

    | Improve this Doc View Source

    CreateItem()

    Create a pooled item and add it to the IManagedPool.

    Declaration
    void CreateItem()
    | Improve this Doc View Source

    ForceRemove(Object)

    Remove an item from an IManagedPool immediately, removing it from tracking and not calling any actions on it.

    Declaration
    void ForceRemove(object item)
    Parameters
    Type Name Description
    System.Object item

    The target System.Object to attempt to remove.

    | Improve this Doc View Source

    Get(Boolean)

    Get the next available item from an IManagedPool.

    Declaration
    object Get(bool triggerOnSpawnedFromPool = true)
    Parameters
    Type Name Description
    System.Boolean triggerOnSpawnedFromPool
    Returns
    Type Description
    System.Object

    An item if available, otherwise null.

    | Improve this Doc View Source

    GetBaseObject()

    Return the System.Object which the pool is built from.

    Declaration
    object GetBaseObject()
    Returns
    Type Description
    System.Object

    The System.Object the IManagedPool is modelled around.

    | Improve this Doc View Source

    GetKey()

    Get the unique identifier for the IManagedPool.

    Declaration
    uint GetKey()
    Returns
    Type Description
    System.UInt32

    A unique identifier.

    | Improve this Doc View Source

    HasMinimumPooledItems()

    Does the IManagedPool contain the minimum number of items.

    Declaration
    bool HasMinimumPooledItems()
    Returns
    Type Description
    System.Boolean

    true/false if enough items are found contained in the IManagedPool.

    | Improve this Doc View Source

    IsAllowedManagedTearDown()

    Should theIManagedPool destroy itself when ManagedPools requests a tear down?

    Declaration
    bool IsAllowedManagedTearDown()
    Returns
    Type Description
    System.Boolean

    true/false if flagged to allow for managed tear down / clean up.

    | Improve this Doc View Source

    IsManaged(Object)

    Is the item managed by this IManagedPool?

    Declaration
    bool IsManaged(object item)
    Parameters
    Type Name Description
    System.Object item

    The System.Object to evaluate.

    Returns
    Type Description
    System.Boolean

    true/false if the item is managed by the IManagedPool.

    | Improve this Doc View Source

    IsPooled(Object)

    Is the provided item found in the IManagedPool's internal available pool of objects?

    Declaration
    bool IsPooled(object item)
    Parameters
    Type Name Description
    System.Object item

    The item to evaluate.

    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Return(Object)

    Return the item to the IManagedPool's internal collection.

    Declaration
    void Return(object item)
    Parameters
    Type Name Description
    System.Object item

    The item to return to the IManagedPool.

    | Improve this Doc View Source

    ReturnAll(Boolean)

    Return all spawned System.Objects to the IManagedPool.

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

    Should the IManagedPool be shrunk to its original maximum size?

    Remarks

    Shrinking the pools helps with pools that have grown out of necessity past their maximum size

    | Improve this Doc View Source

    TearDown()

    Destroy all System.Objects associated with the IManagedPool.

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