Search Results for

    Show / Hide Table of Contents

    Struct SimpleList<T>

    An optimized System.Collections.Generic.List<T>-like data structure.

    Namespace: GDX.Collections.Generic
    Syntax
    [VisualScriptingCompatible((short)1)]
    public struct SimpleList<T>
    Type Parameters
    Name Description
    T

    The type of the System.Objects contained within.

    Constructors

    | Improve this Doc View Source

    SimpleList(T[])

    Create a SimpleList<T> providing an existing arrayToUse.

    Declaration
    public SimpleList(T[] arrayToUse)
    Parameters
    Type Name Description
    T[] arrayToUse

    An existing array to use in the SimpleList<T>.

    | Improve this Doc View Source

    SimpleList(T[], Int32)

    Create a SimpleList<T> providing an existing arrayToUse and setting the Count.

    Declaration
    public SimpleList(T[] arrayToUse, int count)
    Parameters
    Type Name Description
    T[] arrayToUse

    An existing array to use in the SimpleList<T>.

    System.Int32 count

    An existing element count.

    | Improve this Doc View Source

    SimpleList(Int32)

    Create a SimpleList<T> with an initial capacity.

    Declaration
    public SimpleList(int capacity)
    Parameters
    Type Name Description
    System.Int32 capacity

    An initial sizing for the Array.

    Fields

    | Improve this Doc View Source

    Array

    Internal array of backed data for the SimpleList<T>.

    Declaration
    public T[] Array
    Field Value
    Type Description
    T[]
    | Improve this Doc View Source

    Count

    The current number of occupied elements in the CircularBuffer<T>.

    Declaration
    public int Count
    Field Value
    Type Description
    System.Int32
    Remarks

    CAUTION! Changing this will alter the understanding of the data.

    Methods

    | Improve this Doc View Source

    AddExpandClearBoth(T, ArrayPool<T>)

    Add an item to the SimpleList<T>, checking if Array needs to be resized. Clears old and new arrays on resize.

    Declaration
    public void AddExpandClearBoth(T item, ArrayPool<T> pool)
    Parameters
    Type Name Description
    T item

    A typed System.Object to add.

    ArrayPool<T> pool

    Pool to allocate the array from if resizing.

    | Improve this Doc View Source

    AddExpandClearNew(T, ArrayPool<T>)

    Add an item to the SimpleList<T>, checking if Array needs to be resized. Clears unused indices of the new array on resize.

    Declaration
    public void AddExpandClearNew(T item, ArrayPool<T> pool)
    Parameters
    Type Name Description
    T item

    A typed System.Object to add.

    ArrayPool<T> pool

    Pool to allocate the array from if resizing.

    | Improve this Doc View Source

    AddExpandClearOld(T, ArrayPool<T>)

    Add an item to the SimpleList<T>, checking if Array needs to be resized. Clears the old array on resize after copying its contents.

    Declaration
    public void AddExpandClearOld(T item, ArrayPool<T> pool)
    Parameters
    Type Name Description
    T item

    A typed System.Object to add.

    ArrayPool<T> pool

    Pool to allocate the array from if resizing.

    | Improve this Doc View Source

    AddExpandNoClear(T, ArrayPool<T>)

    Add an item to the SimpleList<T>, checking if Array needs to be resized.

    Declaration
    public void AddExpandNoClear(T item, ArrayPool<T> pool)
    Parameters
    Type Name Description
    T item

    A typed System.Object to add.

    ArrayPool<T> pool

    Pool to allocate the array from if resizing.

    | Improve this Doc View Source

    AddUnchecked(T)

    Add an item to the SimpleList<T> without checking the Array size.

    Declaration
    public void AddUnchecked(T item)
    Parameters
    Type Name Description
    T item

    A typed System.Object to add.

    | Improve this Doc View Source

    AddWithExpandCheck(T)

    Add an item to the SimpleList<T>, checking if Array needs to be resized.

    Declaration
    public void AddWithExpandCheck(T item)
    Parameters
    Type Name Description
    T item

    A typed System.Object to add.

    | Improve this Doc View Source

    AddWithExpandCheck(T, Int32)

    Add an item to the SimpleList<T>, checking if Array needs to be resized.

    Declaration
    public void AddWithExpandCheck(T item, int howMuchToExpand)
    Parameters
    Type Name Description
    T item

    A typed System.Object to add.

    System.Int32 howMuchToExpand

    How much to expand the array by.

    | Improve this Doc View Source

    Clear()

    Clear out the Array in SimpleList<T> and sets the Count to 0.

    Declaration
    public void Clear()
    | Improve this Doc View Source

    Compact()

    Shrink/compact the backing Array so there is no unused space.

    Declaration
    public void Compact()
    | Improve this Doc View Source

    InsertExpandClearBoth(Int32, T, ArrayPool<T>)

    Insert an item into the SimpleList<T>, checking if Array needs to be resized. Clears old and new arrays on resize.

    Declaration
    public void InsertExpandClearBoth(int index, T item, ArrayPool<T> pool)
    Parameters
    Type Name Description
    System.Int32 index

    The index in Array to add the item at.

    T item

    A typed System.Object to insert.

    ArrayPool<T> pool

    Pool to allocate the array from if resizing.

    | Improve this Doc View Source

    InsertExpandClearNew(Int32, T, ArrayPool<T>)

    Insert an item into the SimpleList<T>, checking if Array needs to be resized. Clears unused indices of the new array on resize.

    Declaration
    public void InsertExpandClearNew(int index, T item, ArrayPool<T> pool)
    Parameters
    Type Name Description
    System.Int32 index

    The index in Array to add the item at.

    T item

    A typed System.Object to insert.

    ArrayPool<T> pool

    Pool to allocate the array from if resizing.

    | Improve this Doc View Source

    InsertExpandClearOld(Int32, T, ArrayPool<T>)

    Insert an item into the SimpleList<T>, checking if Array needs to be resized. Clears the old array on resize after copying its contents.

    Declaration
    public void InsertExpandClearOld(int index, T item, ArrayPool<T> pool)
    Parameters
    Type Name Description
    System.Int32 index

    The index in Array to add the item at.

    T item

    A typed System.Object to insert.

    ArrayPool<T> pool

    Pool to allocate the array from if resizing.

    | Improve this Doc View Source

    InsertExpandNoClear(Int32, T, ArrayPool<T>)

    Insert an item into the SimpleList<T>, checking if Array needs to be resized.

    Declaration
    public void InsertExpandNoClear(int index, T item, ArrayPool<T> pool)
    Parameters
    Type Name Description
    System.Int32 index

    The index in Array to add the item at.

    T item

    A typed System.Object to insert.

    ArrayPool<T> pool

    Pool to allocate the array from if resizing.

    | Improve this Doc View Source

    InsertUnchecked(Int32, T)

    Insert an item into the SimpleList<T> without checking the Array size.

    Declaration
    public void InsertUnchecked(int index, T item)
    Parameters
    Type Name Description
    System.Int32 index

    The index in Array to add the item at.

    T item

    A typed System.Object to insert.

    | Improve this Doc View Source

    InsertWithExpandCheck(Int32, T)

    Insert an item into the SimpleList<T>, checking if Array needs to be resized.

    Declaration
    public void InsertWithExpandCheck(int index, T item)
    Parameters
    Type Name Description
    System.Int32 index

    The index in Array to add the item at.

    T item

    A typed System.Object to insert.

    | Improve this Doc View Source

    InsertWithExpandCheck(Int32, T, Int32)

    Insert an item into the SimpleList<T>, checking if Array needs to be resized.

    Declaration
    public void InsertWithExpandCheck(int index, T item, int howMuchToExpand)
    Parameters
    Type Name Description
    System.Int32 index

    The index in Array to add the item at.

    T item

    A typed System.Object to insert.

    System.Int32 howMuchToExpand

    The number of elements to add at the end of the array when expanding.

    | Improve this Doc View Source

    RemoveAt(Int32)

    Remove an item from the SimpleList<T> at a specific index.

    Declaration
    public void RemoveAt(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The target index.

    | Improve this Doc View Source

    RemoveAtSwapBack(Int32)

    Remove an item from the SimpleList<T> at a specific index, swapping it with the item from the highest used index.

    Declaration
    public void RemoveAtSwapBack(int index)
    Parameters
    Type Name Description
    System.Int32 index

    The target index.

    | Improve this Doc View Source

    RemoveFromBack()

    Remove the last element in the SimpleList<T>.

    Declaration
    public void RemoveFromBack()
    | Improve this Doc View Source

    Reserve(Int32)

    Resizes the Array, ensuring there are the provided number of empty spots in it.

    Declaration
    public void Reserve(int numberToReserve)
    Parameters
    Type Name Description
    System.Int32 numberToReserve

    Number of desired empty spots.

    | Improve this Doc View Source

    ReserveClearBoth(Int32, ArrayPool<T>)

    Resizes the Array, ensuring there are the provided number of empty spots in it. Clears old and new arrays on resize.

    Declaration
    public void ReserveClearBoth(int numberToReserve, ArrayPool<T> pool)
    Parameters
    Type Name Description
    System.Int32 numberToReserve

    Number of desired empty spots.

    ArrayPool<T> pool

    Pool to allocate the array from if resizing.

    | Improve this Doc View Source

    ReserveClearNew(Int32, ArrayPool<T>)

    Resizes the Array, ensuring there are the provided number of empty spots in it. Clears unused indices of the new array on resize.

    Declaration
    public void ReserveClearNew(int numberToReserve, ArrayPool<T> pool)
    Parameters
    Type Name Description
    System.Int32 numberToReserve

    Number of desired empty spots.

    ArrayPool<T> pool

    Pool to allocate the array from if resizing.

    | Improve this Doc View Source

    ReserveClearOld(Int32, ArrayPool<T>)

    Resizes the Array, ensuring there are the provided number of empty spots in it. Clears the old array on resize after copying its contents.

    Declaration
    public void ReserveClearOld(int numberToReserve, ArrayPool<T> pool)
    Parameters
    Type Name Description
    System.Int32 numberToReserve

    Number of desired empty spots.

    ArrayPool<T> pool

    Pool to allocate the array from if resizing.

    | Improve this Doc View Source

    ReserveNoClear(Int32, ArrayPool<T>)

    Resizes the Array, ensuring there are the provided number of empty spots in it.

    Declaration
    public void ReserveNoClear(int numberToReserve, ArrayPool<T> pool)
    Parameters
    Type Name Description
    System.Int32 numberToReserve

    Number of desired empty spots.

    ArrayPool<T> pool

    Pool to allocate the array from if resizing.

    | Improve this Doc View Source

    Reverse()

    Reverse the order of Array.

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