@studiokeywi/banjo - v0.0.1
    Preparing search index...

    Interface ObjectPool<Type, InitArgs>

    An object pool consists of a containing array using a (pseudo-)free list to provide reusable objects of a given type

    interface ObjectPool<Type extends object, InitArgs extends unknown[]> {
        get size(): number;
        next(...args: InitArgs): Pooled<Type>;
    }

    Type Parameters

    • Type extends object

      The type of objects contained within the pool

    • InitArgs extends unknown[]

      Arguments provided when initializing a pool object

    Index

    Accessors

    Methods

    Accessors

    • get size(): number

      The amount of objects currently available in the pool

      Returns number

    Methods

    • Get the next available object from the pool

      Parameters

      • ...args: InitArgs

        Arguments to initialize the pooled object

      Returns Pooled<Type>

      The pooled object