Astra Unity 2.6.6
Astra Unity Plugin
Astra.Serialization.SerializableDictionary< A, B > Class Template Reference

Serializable dictionary that uses tuplets as key/value pairs More...

Inheritance diagram for Astra.Serialization.SerializableDictionary< A, B >:

Classes

class  SerializableDictionaryEnumerator
 Enumerator for this dictionary More...
 

Public Member Functions

Type GetKeyType ()
 Retreives the type of the key element More...
 
Type GetValType ()
 Retreives the type of the value element More...
 
void Clear ()
 Clears the dictionary
 
void CopyTo (KeyValuePair< A, B >[] pairs, int index)
 Defined in the IDictionary interface, but not implemented here
 
bool Contains (KeyValuePair< A, B > pair)
 Whether the given key is found in the dictionary More...
 
void Add (KeyValuePair< A, B > pair)
 Adds the given key/value pair into the dictionary More...
 
bool Remove (KeyValuePair< A, B > pair)
 Removes the given key/value pair from the dictionary More...
 
bool ContainsKey (A a)
 Whether the dictionary contains this key More...
 
bool ContainsValue (B b)
 Whether the dictionary contains this value More...
 
void Add (A a, B b)
 Adds this key/value pair to the dictionary More...
 
bool Remove (A a)
 Removes this key/value pair from the dictionary More...
 
Tuplet< A, B > GetFromSlot (int slot)
 Retrieves the tuplet at a given index More...
 
GetSecondFromSlot (int slot)
 Get the 2nd element (the value) from a given index More...
 
bool TryGetValue (A a, out B b)
 Attempts to retrieve the value for the given key. Returns false if the key does not exist in this dictionary. More...
 
void OnBeforeSerialize ()
 Implementation for Unity ISerializationCallbackReceiver
 
void OnAfterDeserialize ()
 Implementation for Unity ISerializationCallbackReceiver
 
virtual void Upsert (System.Object a, System.Object b)
 Adds or updates the value for the given key More...
 
void RemoveKey (System.Object a)
 Removes the tuplet for the given key More...
 
SerializableDictionaryEnumerator GetEnumerator ()
 Retrieves an enumerator for this dictionary
 
System.Collections.IEnumerator GetEnumeratorGeneric ()
 Retreives a generic enumerator for this dictionary More...
 

Protected Attributes

Tuplets< A, B > __tuplets = null
 

Properties

virtual Tuplets< A, B > _tuplets [getset]
 
int Count [get]
 Count of tuplets in the dictionary
 
ICollection< A > Keys [get]
 Retreives the list of keys
 
ICollection< B > Values [get]
 Retrieves the list of values
 
bool IsReadOnly [get]
 Whether this is read only
 
this[A key] [getset]
 Returns the value from the given key More...
 
- Properties inherited from Astra.Serialization.ISerializableDictionary
int Count [get]
 

Detailed Description

Serializable dictionary that uses tuplets as key/value pairs

Template Parameters
AType of the key element
BType of the value element

Member Function Documentation

◆ Add() [1/2]

void Astra.Serialization.SerializableDictionary< A, B >.Add ( a,
b 
)
inline

Adds this key/value pair to the dictionary

Parameters
aKey to add
bValue to add

◆ Add() [2/2]

void Astra.Serialization.SerializableDictionary< A, B >.Add ( KeyValuePair< A, B >  pair)
inline

Adds the given key/value pair into the dictionary

Parameters
pairKey/value pair to add

◆ Contains()

bool Astra.Serialization.SerializableDictionary< A, B >.Contains ( KeyValuePair< A, B >  pair)
inline

Whether the given key is found in the dictionary

Parameters
pairKey/value pair to check whether the key value exists in this dictionary

◆ ContainsKey()

bool Astra.Serialization.SerializableDictionary< A, B >.ContainsKey ( a)
inline

Whether the dictionary contains this key

Parameters
aKey to look for

◆ ContainsValue()

bool Astra.Serialization.SerializableDictionary< A, B >.ContainsValue ( b)
inline

Whether the dictionary contains this value

Parameters
bValue to look for

◆ GetEnumeratorGeneric()

System.Collections.IEnumerator Astra.Serialization.SerializableDictionary< A, B >.GetEnumeratorGeneric ( )
inline

Retreives a generic enumerator for this dictionary

Implements Astra.Serialization.ISerializableDictionary.

◆ GetFromSlot()

Tuplet< A, B > Astra.Serialization.SerializableDictionary< A, B >.GetFromSlot ( int  slot)
inline

Retrieves the tuplet at a given index

Parameters
slotIndex to return the tuplet from

◆ GetKeyType()

Type Astra.Serialization.SerializableDictionary< A, B >.GetKeyType ( )
inline

Retreives the type of the key element

Implements Astra.Serialization.ISerializableDictionary.

◆ GetSecondFromSlot()

B Astra.Serialization.SerializableDictionary< A, B >.GetSecondFromSlot ( int  slot)
inline

Get the 2nd element (the value) from a given index

Parameters
slotIndex to get the value from

◆ GetValType()

Type Astra.Serialization.SerializableDictionary< A, B >.GetValType ( )
inline

Retreives the type of the value element

Implements Astra.Serialization.ISerializableDictionary.

◆ Remove() [1/2]

bool Astra.Serialization.SerializableDictionary< A, B >.Remove ( a)
inline

Removes this key/value pair from the dictionary

Parameters
aKey to remove

◆ Remove() [2/2]

bool Astra.Serialization.SerializableDictionary< A, B >.Remove ( KeyValuePair< A, B >  pair)
inline

Removes the given key/value pair from the dictionary

Parameters
pairKey/value pair to remove (pair is found by key)

◆ RemoveKey()

void Astra.Serialization.SerializableDictionary< A, B >.RemoveKey ( System.Object  a)
inline

Removes the tuplet for the given key

Parameters
aKey to remove

Implements Astra.Serialization.ISerializableDictionary.

◆ TryGetValue()

bool Astra.Serialization.SerializableDictionary< A, B >.TryGetValue ( a,
out B  b 
)
inline

Attempts to retrieve the value for the given key. Returns false if the key does not exist in this dictionary.

Parameters
aKey to retrieve
bValue from the given key

◆ Upsert()

virtual void Astra.Serialization.SerializableDictionary< A, B >.Upsert ( System.Object  a,
System.Object  b 
)
inlinevirtual

Adds or updates the value for the given key

Parameters
aKey to add/update
bValue to set for this key

Implements Astra.Serialization.ISerializableDictionary.

Property Documentation

◆ this[A key]

B Astra.Serialization.SerializableDictionary< A, B >.this[A key]
getset

Returns the value from the given key

Parameters
keyKey to retrieve the value for

The documentation for this class was generated from the following file: