Class FixedList64BytesExtensions
Provides extension methods for FixedList64Bytes.
Namespace: Unity.Collections
Assembly: Unity.Collections.dll
Syntax
public static class FixedList64BytesExtensions
Methods
Contains<T, U>(ref FixedList64Bytes<T>, U)
Returns true if a particular value is present in this list.
Declaration
public static bool Contains<T, U>(this ref FixedList64Bytes<T> list, U value) where T : unmanaged, IEquatable<U>
Parameters
Type | Name | Description |
---|---|---|
FixedList64Bytes<T> | list | The list to search. |
U | value | The value to locate. |
Returns
Type | Description |
---|---|
bool | 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 FixedList64Bytes<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 FixedList64Bytes<T> list, U value) where T : unmanaged, IEquatable<U>
Parameters
Type | Name | Description |
---|---|---|
FixedList64Bytes<T> | list | The list to search. |
U | value | The value to locate. |
Returns
Type | Description |
---|---|
int | 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. |
RemoveSwapBack<T, U>(ref FixedList64Bytes<T>, U)
Removes the first occurrence of a particular value in this list.
Declaration
public static bool RemoveSwapBack<T, U>(this ref FixedList64Bytes<T> list, U value) where T : unmanaged, IEquatable<U>
Parameters
Type | Name | Description |
---|---|---|
FixedList64Bytes<T> | list | The list to search. |
U | value | The value to locate and remove. |
Returns
Type | Description |
---|---|
bool | 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 FixedList64Bytes<T>, U), but the order of the remaining elements is not preserved.
Remove<T, U>(ref FixedList64Bytes<T>, U)
Removes the first occurrence of a particular value in this list.
Declaration
public static bool Remove<T, U>(this ref FixedList64Bytes<T> list, U value) where T : unmanaged, IEquatable<U>
Parameters
Type | Name | Description |
---|---|---|
FixedList64Bytes<T> | list | The list to search. |
U | value | The value to locate and remove. |
Returns
Type | Description |
---|---|
bool | 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 FixedList64Bytes<T>, U) is a cheaper alternative.