-
-
Notifications
You must be signed in to change notification settings - Fork 0
PseudoSerializableDictionary
Namespace: Lowry.Utils.CodeExtensions
public sealed class PseudoSerializableDictionary<TKey, TValue>
InputLayers makes use of a serializable "dictionary", which consists instead of a List
of keys and a List
of values kept in sync.
This "dictionary" functions a lot like a typical C# Dictionary🔗.
public List<TKey> Keys { get {...}, set {...} }
Stores the
TKey
keys of the dictionary.
public List<TValue> Values { get {...}, set {...} }
Stores the
TValue
values of the dictionary.
public int Count { get {...} }
Returns: the number of elements currently in the dictionary.
public void Set (TKey key, TValue value) {...}
Assigns a
value
to a specifickey
in the dictionary.
public void Set (KeyValuePair<TKey, TValue> pair) {...}
Adds a
KeyValuePair
direcly to the dictionary.
public void Set (TKey key, TValue value) {...}
Removes the entry at a specific
key
from the dictionary.Returns:
true
if thekey
was found and removed.
public void Set (KeyValuePair<TKey, TValue> pair) {...}
Removes the entry at a specific
KeyValuePair
'skey
from the dictionary.Returns:
true
if theKeyValuePair
'skey
was found and removed.
public void RemoveAt (int id) {...}
Removes the entry at a specific
id
in the dictionary.Returns:
true
if theid
was found and removed.
public void Contains (TKey key) {...}
Returns:
true
if thekey
was found in the dictionary.
public void Contains (KeyValuePair<TKey, TValue> pair) {...}
Returns:
true
if theKeyValuePair
'skey
was found in the dictionary.
public void Clear () {...}
Clears the contents of the dictionary.
public TValue At (int id) {...}
Returns: the
TValue
found at the positionid
in dictionary ordefault
if the id is ut of bounds.
public TValue At (TKey key) {...}
Returns: the
TValue
corresponding to theTKey
in dictionary or throws anArgumentOutOfRangeException
if theTKey
cannot be found in the dictionary.
👉🏻 Download InputLayers on the Unity Asset Store!