Struct SubArray<T>
- Namespace
- ToolBuddy.Pooling.Collections
A struct that helps you use a part of an array.
public readonly struct SubArray<T>
Type Parameters
T
Remarks
Can be reused if you free it by calling Free(SubArray<T>)
Constructors
SubArray(T[])
Creates an instance that will use all the elements of the given array
public SubArray(T[] array)
Parameters
arrayT[]
SubArray(T[], int)
Creates an instance that will use the first "count" elements of the given array
public SubArray(T[] array, int count)
Parameters
arrayT[]countint
Fields
Array
The array where data is stored in. Warning, its length might be bigger than Count.
public readonly T[] Array
Field Value
- T[]
Count
The number of elements to be used in that array, counted from the start of the array. Use this instead of Array.Length
public readonly int Count
Field Value
Properties
this[int]
Returns the array element at the given index
public T this[int index] { get; set; }
Parameters
indexint
Property Value
- T
Methods
CopyToArray(ArrayPool<T>)
public T[] CopyToArray(ArrayPool<T> arrayPool)
Parameters
arrayPoolArrayPool<T>
Returns
- T[]
Equals(object)
public override bool Equals(object obj)
Parameters
objobject
Returns
Equals(SubArray<T>)
public bool Equals(SubArray<T> obj)
Parameters
objSubArray<T>
Returns
GetHashCode()
public override int GetHashCode()
Returns
Operators
operator ==(SubArray<T>, SubArray<T>)
public static bool operator ==(SubArray<T> a, SubArray<T> b)
Parameters
Returns
operator !=(SubArray<T>, SubArray<T>)
public static bool operator !=(SubArray<T> a, SubArray<T> b)