Struct EnumArray<TKey, TValue>
Defines structure with internal array which elements can be accessed using enum values as the indexes.
public struct EnumArray<TKey, TValue> where TKey : struct, Enum, IConvertible
Type Parameters
TKey
Type of the enum used as the index in the array.
TValue
Type of the array elements.
Constructors
- EnumArray()
Initializes a new instance of the EnumArray<TKey, TValue> struct.
- EnumArray(int)
Initializes a new instance of the EnumArray<TKey, TValue> struct.
- EnumArray(TKey)
Initializes a new instance of the EnumArray<TKey, TValue> struct.
Fields
- Data
Array with data.
Properties
- this[int]
Gets or sets array element.
- this[TKey]
Gets or sets array element.
- this[TKey[]]
Sets the same value to all the items with the specified keys.
Methods
- Assign(EnumArray<TKey, TValue>)
Assigns properties of this object with the properties of another object.
- Clone()
Creates clone of this object.
- ConvertAllItems<T>(Func<TValue, T, TValue>, T)
Converts each item by calling
conversion
function.
- ForEachKey(Action<TKey>)
Calls the specified action for the each key of the enum array (= for the each enum element).
- Reset()
Resets all data.
- SetValues(TValue, TKey[])
Sets the same value to all the items with the specified keys.