Struct Array3DState<T>
- Namespace
- SwiftCollections
- Assembly
- SwiftCollections.dll
Represents the immutable state of a three-dimensional array, including its dimensions and underlying data.
[MemoryPackable(GenerateType.Object)]
public readonly struct Array3DState<T> : IMemoryPackable<Array3DState<T>>, IMemoryPackFormatterRegister
Type Parameters
TThe type of elements stored in the array.
- Implements
-
IMemoryPackable<Array3DState<T>>IMemoryPackFormatterRegister
- Inherited Members
Remarks
This struct is intended for scenarios where a snapshot of a 3D array's state is needed, such as serialization or state management. The data is stored in a one-dimensional array in row-major order. The struct is serializable and compatible with supported serialization frameworks.
Constructors
Array3DState(int, int, int, T[])
Initializes a new instance of the Array3DState class with the specified dimensions and data.
[JsonConstructor]
[MemoryPackConstructor]
public Array3DState(int width, int height, int depth, T[] data)
Parameters
widthintThe number of elements along the X-axis. Must be greater than zero.
heightintThe number of elements along the Y-axis. Must be greater than zero.
depthintThe number of elements along the Z-axis. Must be greater than zero.
dataT[]A one-dimensional array containing the elements of the 3D array, stored in row-major order. The length must equal width × height × depth.
Fields
Data
Gets the underlying array of data elements contained in the collection.
[JsonInclude]
[MemoryPackInclude]
public readonly T[] Data
Field Value
- T[]
Depth
Gets the depth value represented by this field.
[JsonInclude]
[MemoryPackInclude]
public readonly int Depth
Field Value
Height
Gets the height value represented by this field.
[JsonInclude]
[MemoryPackInclude]
public readonly int Height
Field Value
Width
Gets the width value represented by this field.
[JsonInclude]
[MemoryPackInclude]
public readonly int Width