-
-
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 {...} }Stores the
TKeykeys of the dictionary.
public List<TValue> Values { get {...} }Stores the
TValuevalues of the dictionary.
public int Count { get {...} }Returns: the number of elements currently in the dictionary.
public PseudoSerializableDictionary () {...}Initializes a new, empty dictionary.
public PseudoSerializableDictionary (IEnumerable<TKey> keys_, IEnumerable<TValue> values_) {...}Initializes a new dictionary populated with an initial set of keys and values.
public void Set (TKey key, TValue value) {...}Assigns a
valueto a specifickeyin the dictionary.
public void Set (KeyValuePair<TKey, TValue> pair) {...}Adds a
KeyValuePairdirectly to the dictionary.
public bool Remove (TKey key) {...}Removes the entry at a specific
keyfrom the dictionary.Returns:
trueif thekeywas found and removed.
public bool Remove (KeyValuePair<TKey, TValue> pair) {...}Removes the entry at a specific
KeyValuePair'skeyfrom the dictionary.Returns:
trueif theKeyValuePair'skeywas found and removed.
public bool RemoveAt (int id) {...}Removes the entry at a specific
idin the dictionary.Returns:
trueif theidwas found and removed.
public bool ContainsKey (TKey key) {...}Returns:
trueif thekeywas found in the dictionary.
public bool Contains (KeyValuePair<TKey, TValue> pair) {...}Returns:
trueif theKeyValuePair'skeywas found in the dictionary.
public bool ContainsValue (TValue value) {...}Returns:
trueif thevaluewas found in the dictionary.
public bool TryGetValue (TKey key, out TValue value) {...}Returns:
trueif thekeywas found in the dictionary, and setsvalueto the correspondingTValue.
public void Clear () {...}Clears the contents of the dictionary.
public TValue At (int id) {...}Returns: the
TValuefound at the positionidin dictionary ordefaultif the id is out of bounds.
public TValue At (TKey key) {...}Returns: the
TValuecorresponding to theTKeyin dictionary or throws anArgumentOutOfRangeExceptionif theTKeycannot be found in the dictionary.
👉🏻 Download InputLayers on the Unity Asset Store!