Class ReadOnlyArrayExtensions
Extension methods to help with ReadOnlyArrayExtensions contents.
Namespace: UnityEngine.InputSystem.Utilities
Syntax
public static class ReadOnlyArrayExtensions
Methods
Contains<TValue>(ReadOnlyArray<TValue>, TValue)
Evaluates whether array
contains an element that compares equal to value
.
Declaration
public static bool Contains<TValue>(this ReadOnlyArray<TValue> array, TValue value)
where TValue : IComparable<TValue>
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyArray<TValue> | array | Reference to the read-only array to be searched. |
TValue | value | The value to be searched for in |
Returns
Type | Description |
---|---|
Boolean |
|
Type Parameters
Name | Description |
---|---|
TValue | The array element type. |
ContainsReference<TValue>(ReadOnlyArray<TValue>, TValue)
Evaluates whether array
contains a reference to value
.
Declaration
public static bool ContainsReference<TValue>(this ReadOnlyArray<TValue> array, TValue value)
where TValue : class
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyArray<TValue> | array | Reference to the read-only array to be searched. |
TValue | value | The reference to be searched for in |
Returns
Type | Description |
---|---|
Boolean |
|
Type Parameters
Name | Description |
---|---|
TValue | The array element type. |
IndexOfReference<TValue>(ReadOnlyArray<TValue>, TValue)
Retrieves the index of value
in array
.
Declaration
public static int IndexOfReference<TValue>(this ReadOnlyArray<TValue> array, TValue value)
where TValue : class
Parameters
Type | Name | Description |
---|---|---|
ReadOnlyArray<TValue> | array | Reference to the read-only array to be searched. |
TValue | value | The reference to be searched for in |
Returns
Type | Description |
---|---|
Int32 | The zero-based index of element |
Type Parameters
Name | Description |
---|---|
TValue | The array element type. |