Class FixedList32BytesExtensions
Provides extension methods for FixedList32Bytes.
Namespace: Unity.Collections
Syntax
public static class FixedList32BytesExtensions
Methods
Contains<T, U>(ref FixedList32Bytes<T>, U)
Returns true if a particular value is present in this list.
Declaration
public static bool Contains<T, U>(this ref FixedList32Bytes<T> list, U value)
where T : struct, IEquatable<U>
Parameters
Type | Name | Description |
---|---|---|
FixedList32Bytes<T> | list | The list to search. |
U | value | The value to locate. |
Returns
Type | Description |
---|---|
Boolean | True if the value is present in this list. |
Type Parameters
Name | Description |
---|---|
T | The type of elements in this list. |
U | The value type. |
IndexOf<T, U>(ref FixedList32Bytes<T>, U)
Finds the index of the first occurrence of a particular value in this list.
Declaration
public static int IndexOf<T, U>(this ref FixedList32Bytes<T> list, U value)
where T : struct, IEquatable<U>
Parameters
Type | Name | Description |
---|---|---|
FixedList32Bytes<T> | list | The list to search. |
U | value | The value to locate. |
Returns
Type | Description |
---|---|
Int32 | The index of the first occurrence of the value. Returns -1 if no occurrence is found. |
Type Parameters
Name | Description |
---|---|
T | The type of elements in this list. |
U | The value type. |
Remove<T, U>(ref FixedList32Bytes<T>, U)
Removes the first occurrence of a particular value in this list.
Declaration
public static bool Remove<T, U>(this ref FixedList32Bytes<T> list, U value)
where T : struct, IEquatable<U>
Parameters
Type | Name | Description |
---|---|---|
FixedList32Bytes<T> | list | The list to search. |
U | value | The value to locate and remove. |
Returns
Type | Description |
---|---|
Boolean | True if the value was found and removed. |
Type Parameters
Name | Description |
---|---|
T | The type of elements in this list. |
U | The value type. |
Remarks
If a value is removed, all elements after it are shifted down by one, and the list's length is decremented by one.
If you don't need to preserve the order of the remaining elements, RemoveSwapBack<T, U>(ref FixedList32Bytes<T>, U) is a cheaper alternative.
RemoveSwapBack<T, U>(ref FixedList32Bytes<T>, U)
Removes the first occurrence of a particular value in this list.
Declaration
public static bool RemoveSwapBack<T, U>(this ref FixedList32Bytes<T> list, U value)
where T : struct, IEquatable<U>
Parameters
Type | Name | Description |
---|---|---|
FixedList32Bytes<T> | list | The list to search. |
U | value | The value to locate and remove. |
Returns
Type | Description |
---|---|
Boolean | Returns true if the item is removed. |
Type Parameters
Name | Description |
---|---|
T | The type of elements in this list. |
U | The value type. |
Remarks
If a value is removed, the last element of the list is copied to overwrite the removed value, and the list's length is decremented by one.
This is cheaper than Remove<T, U>(ref FixedList32Bytes<T>, U), but the order of the remaining elements is not preserved.