Search Results for

    Show / Hide Table of Contents

    Struct Array2D<T>

    A 2-dimensional array backed by a flat array.

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

    Type of objects.

    Remarks

    Mimics multi-dimensional array format.

    Constructors

    | Improve this Doc View Source

    Array2D(Int32, Int32)

    Create a Array2D<T>.

    Declaration
    public Array2D(int rowCount, int columnCount)
    Parameters
    Type Name Description
    System.Int32 rowCount

    The number of rows (X).

    System.Int32 columnCount

    The number of columns (Y).

    | Improve this Doc View Source

    Array2D(Int32, Int32, T[])

    Create a Array2D<T> providing an existing arrayToUse.

    Declaration
    public Array2D(int rowCount, int columnCount, T[] arrayToUse)
    Parameters
    Type Name Description
    System.Int32 rowCount

    The number of rows (X).

    System.Int32 columnCount

    The number of columns (Y).

    T[] arrayToUse

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

    Fields

    | Improve this Doc View Source

    Array

    The backing flat array.

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

    ColumnCount

    The length of each pseudo-array in the dataset.

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

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

    | Improve this Doc View Source

    RowCount

    The number of pseudo-arrays created to support the dimensionality.

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

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

    Properties

    | Improve this Doc View Source

    Item[Int32, Int32]

    Get a typed object at a specific 2-dimensional index in Array.

    Declaration
    public T this[int x, int y] { get; set; }
    Parameters
    Type Name Description
    System.Int32 x

    The row/line number (vertical axis).

    System.Int32 y

    The column number (horizontal axis).

    Property Value
    Type Description
    T

    Methods

    | Improve this Doc View Source

    AddColumns(Int32)

    Add additional columns to the dataset.

    Declaration
    public void AddColumns(int numberOfNewColumns)
    Parameters
    Type Name Description
    System.Int32 numberOfNewColumns

    The number of columns add.

    | Improve this Doc View Source

    AddRows(Int32)

    Add additional rows to the dataset.

    Declaration
    public void AddRows(int numberOfNewRows)
    Parameters
    Type Name Description
    System.Int32 numberOfNewRows

    The number of rows/arrays to add.

    | Improve this Doc View Source

    Dispose()

    Properly dispose of the Array2D<T>.

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

    GetColumnIndex(Int32)

    Get the column index of the provided index.

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

    A valid index contained within Array.

    Returns
    Type Description
    System.Int32

    The column index.

    | Improve this Doc View Source

    GetRowIndex(Int32)

    Get the row index of the provided index.

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

    A valid index contained within Array.

    Returns
    Type Description
    System.Int32

    The row index.

    | Improve this Doc View Source

    ReverseColumns()

    Reverse the order of the columns in the backing Array.

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

    ReverseRows()

    Reverse the order of the rows in the backing Array.

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

    RotateClockwise()

    Rotate internal dataset clockwise.

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

    RotateCounterClockwise()

    Rotate internal dataset counter-clockwise.

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

    ToMultiDimensionalArray()

    Creates a copy of the internal array as a traditional multi-dimensional array.

    Declaration
    public T[, ] ToMultiDimensionalArray()
    Returns
    Type Description
    T[,]

    A new copy of the backing Array in multi-dimensional form.

    Remarks

    Useful for scenarios where fills need to be done with [,] structured multi-dimensional arrays.

    Implements

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