Class ArrayLookup
Extension methods for looking up elements in 3D C# arrays using Unity int-vectors.
Inheritance
System.Object
ArrayLookup
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: CarbideFunction.Wildtile
Syntax
public static class ArrayLookup
Methods
Contains(Vector3Int, Vector3Int)
Test if a coordinate is within the supplied dimensions.
Note this does not check if there is an instance of coordinates in sourceArray
, like C# Contains
methods
Declaration
public static bool Contains(this Vector3Int dimensions, Vector3Int coordinates)
Parameters
Type | Name | Description |
---|---|---|
Vector3Int | dimensions | |
Vector3Int | coordinates |
Returns
Type | Description |
---|---|
System.Boolean |
Contains<ArrayContents>(ArrayContents[,,], Vector3Int)
Test if a coordinate is within an array's dimensions.
Note this does not check if there is an instance of coordinates in sourceArray
, like C# Contains
methods
Declaration
public static bool Contains<ArrayContents>(this ArrayContents[,, ] sourceArray, Vector3Int coordinates)
Parameters
Type | Name | Description |
---|---|---|
ArrayContents[,,] | sourceArray | |
Vector3Int | coordinates |
Returns
Type | Description |
---|---|
System.Boolean |
Type Parameters
Name | Description |
---|---|
ArrayContents |
Dimensions<ArrayContents>(ArrayContents[,,])
Get a 3D array's dimensions in Vector3Int form
Declaration
public static Vector3Int Dimensions<ArrayContents>(this ArrayContents[,, ] sourceArray)
Parameters
Type | Name | Description |
---|---|---|
ArrayContents[,,] | sourceArray |
Returns
Type | Description |
---|---|
Vector3Int |
Type Parameters
Name | Description |
---|---|
ArrayContents |
Lookup<ArrayContents>(ArrayContents[,,], Vector3Int)
Find an element in a 3D array by Unity Vector3Int coordinates.
Declaration
public static ref ArrayContents Lookup<ArrayContents>(this ArrayContents[,, ] sourceArray, Vector3Int coordinates)
Parameters
Type | Name | Description |
---|---|---|
ArrayContents[,,] | sourceArray | |
Vector3Int | coordinates |
Returns
Type | Description |
---|---|
ArrayContents |
Type Parameters
Name | Description |
---|---|
ArrayContents |