Class ArrayExtensions
- Namespace
- FishMMO.Shared
- Assembly
- FishMMO-SharedUtility.dll
Extension methods for populating jagged arrays with new instances of type T. Useful for initializing grids, voxels, or nested data structures in FishMMO.
public static class ArrayExtensions
- Inheritance
-
ArrayExtensions
- Inherited Members
Methods
Populate<T>(T[]?)
Populates a 1D array with new instances of type T.
public static T[]? Populate<T>(this T[]? array) where T : new()
Parameters
arrayT[]
Returns
- T[]
Type Parameters
T
Populate<T>(T[][]?)
Populates a 2D jagged array. Each sub-array is sized to the outer array's length.
public static T[][]? Populate<T>(this T[][]? array) where T : new()
Parameters
arrayT[][]
Returns
- T[][]
Type Parameters
T
Populate<T>(T[][]?, int)
Populates a 2D jagged array specifying the height (inner dimension) of each sub-array.
public static T[][]? Populate<T>(this T[][]? array, int height) where T : new()
Parameters
arrayT[][]heightint
Returns
- T[][]
Type Parameters
T
Populate<T>(T[][][]?)
Populates a 3D jagged array using the outer dimension for all sizes.
public static T[][][]? Populate<T>(this T[][][]? array) where T : new()
Parameters
arrayT[][][]
Returns
- T[][][]
Type Parameters
T
Populate<T>(T[][][]?, int, int)
Populates a 3D jagged array with specific height and depth.
public static T[][][]? Populate<T>(this T[][][]? array, int height, int depth) where T : new()
Parameters
Returns
- T[][][]
Type Parameters
T