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

Contains a list of 2 type tuplets More...

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

Classes

class  TupletsEnumerator
 

Public Member Functions

Tuplet< A, B > GetFromFirst (A a)
 Finds a tuplet, using the 1st element More...
 
Tuplet< A, B > GetFromSecond (B b)
 Finds a tuplet, using the 2nd element More...
 
Tuplet< A, B > GetFromSlot (int slot)
 Retrieves the tuplet at the given index More...
 
void Upsert (Tuplet< A, B > tuplet)
 Adds the given tuplet into the list if it is not there, updates it if it is More...
 
int GetSlotFromFirst (A a)
 Find the index of the Tuplet by 1st element value More...
 
int GetSlotFromSecond (B b)
 Find the index of the Tuplet by 2nd element value More...
 
void Clear ()
 Clears the list of Tuplets
 
void OnBeforeSerialize ()
 Implementation for Unity ISerializationCallbackReceiver
 
void BuildFirstSecond ()
 Update the lists of First and Second elements
 
void OnAfterDeserialize ()
 Implementation for Unity ISerializationCallbackReceiver
 
void MarkLookupsDirty ()
 
void Reindex (bool force=false)
 Update the indices of the Tuplets in the list
 
void ReindexAdd (Tuplet< A, B > record)
 A more efficient way to index the tuplet lookups knowing we just added to the list More...
 
virtual void UpsertBySlot (int slot, System.Object a, System.Object b)
 Adds or updates an entry, using generic values. Replaces an entry by slot, not by key/values More...
 
virtual void UpsertBySlot (int slot, A a, B b)
 Adds or updates an entry, using typed values. Replaces an entry by slot, not by key/values More...
 
virtual void UpsertBySlot (int slot, Tuplet< A, B > tuplet)
 Adds or updates an entry, using a passed in tuplet. Replaces an entry by slot, not by key/values More...
 
virtual void Add (System.Object a, System.Object b)
 Adds a Tuple using the given elements More...
 
virtual void Add (Tuplet< A, B > tuplet)
 Adds a Tuple to the list More...
 
virtual void RemoveBySlot (int slot, bool reindex=false)
 Removes a tuplet at the given index More...
 
virtual void RemoveByFirst (A a)
 Removes the tuplet with the given 1st element value More...
 
virtual void RemoveBySecond (B b)
 Removes the tuplet with the given 2nd element value More...
 
Tuplet< System.Object, System.Object > GetFromSlotGeneric (int slot)
 Retrieve a generic tuplet from the given index More...
 
virtual IEnumerator GetEnumerator ()
 Retrieves a typed enumerator More...
 
IEnumerator GetEnumeratorGeneric ()
 Retrieves a generic enumerator More...
 
GetFromSlot< R > (int slot)
 Yields a tuplet back as the T type Warning: this gives you a COPY of the original, not a reference to the original! If you modify your result, you must re-upsert back in! More...
 
bool MoveNext ()
 
void Reset ()
 
new IEnumerator< T > GetEnumerator ()
 
System.Type GetFirstType ()
 
System.Type GetSecondType ()
 
System.Type GetThirdType ()
 
int GetSlotFromFirst (A a)
 Find the index of the Tuplet by 1st element value More...
 
int GetSlotFromSecond (B b)
 Find the index of the Tuplet by 2nd element value More...
 
int GetSlotFromThird (C c)
 Find the index of the Tuplet by 3rd element value More...
 
Tuplet< A, B, C > GetFromFirst (A a)
 Retrieve the Tuplet by 1st element value More...
 
Tuplet< A, B, C > GetFromSecond (B b)
 Retrieve the Tuplet by 2nd element value More...
 
Tuplet< A, B, C > GetFromThird (C c)
 Retrieve the Tuplet by 3rd element value More...
 
virtual bool ContainsFirst (A a)
 Whether the list contains a 1st element with the given value More...
 
virtual bool ContainsSecond (B b)
 Whether the list contains a 2nd element with the given value More...
 
virtual bool ContainsThird (C c)
 Whether the list contains a 3rd element with the given value More...
 
virtual Tuplet< A, B, C > GetFromSlot (int slot)
 Retrieves the Tuplet at the given index More...
 
void Upsert (Tuplet< A, B, C > tuplet)
 Adds or updates the given tuplet in the list More...
 
void Clear ()
 Clears the list of tuplets
 
void OnBeforeSerialize ()
 Implementation for Unity ISerializationCallbackReceiver
 
void OnAfterDeserialize ()
 Implementation for Unity ISerializationCallbackReceiver
 
void Reindex ()
 Update the indices of the Tuplets in the list
 
virtual void UpsertBySlot (int slot, System.Object a, System.Object b, System.Object c)
 Adds or updates an entry, using generic values. Replaces an entry by slot, not by key/values More...
 
virtual void UpsertBySlot (int slot, A a, B b, C c)
 Adds or updates an entry, using typed values. Replaces an entry by slot, not by key/values More...
 
virtual void UpsertBySlot (int slot, Tuplet< A, B, C > tuplet)
 Adds or updates an entry, using a passed in tuplet. Replaces an entry by slot, not by key/values More...
 
virtual void Add (System.Object a, System.Object b, System.Object c)
 Adds a Tuple using the given elements More...
 
virtual void Add (Tuplet< A, B, C > tuplet)
 Adds a Tuple to the list More...
 
virtual void RemoveBySlot (int slot, bool reindex=true)
 Removes a tuplet at the given index More...
 
virtual bool RemoveFromFirst (A a)
 Removes the tuplet with the given 1st element value More...
 
virtual bool RemoveFromSecond (B b)
 Removes the tuplet with the given 2nd element value More...
 
virtual bool RemoveFromThird (C c)
 Removes the tuplet with the given 3rd element value More...
 
Tuplet< System.Object, System.Object, System.Object > GetFromSlotGeneric (int slot)
 Retrieve a generic tuplet from the given index More...
 
virtual IEnumerator GetEnumerator ()
 Retrieves a typed enumerator More...
 
IEnumerator GetEnumeratorGeneric ()
 Retrieves a generic enumerator More...
 

Public Attributes

List< Tuplet< A, B > > Items = new List<Tuplet<A, B>>()
 
List< A > First = new List<A>()
 
List< B > Second = new List<B>()
 
bool UniqueByPair = true
 
List< Tuplet< A, B, C > > Items = new List<Tuplet<A, B, C>>()
 
System.Type FirstType = typeof(A)
 
System.Type SecondType = typeof(B)
 
System.Type ThirdType = typeof(C)
 

Protected Attributes

int _position =-1
 
List< C > Third = new List<C>()
 
Dictionary< C, int > _lookupC = new Dictionary<C, int>()
 

Properties

int Count [get]
 Count of tuplets in the list
 
object Current [get]
 
- Properties inherited from Astra.Serialization.ITuplets2
int Count [get]
 
- Properties inherited from Astra.Serialization.ITuplets2T< A, B >
int Count [get]
 
- Properties inherited from Astra.Serialization.ITuplets3
int Count [get]
 
- Properties inherited from Astra.Serialization.ITuplets3T< A, B, C >
int Count [get]
 

Detailed Description

Contains a list of 2 type tuplets

Contains a list of 3 type tuplets

Template Parameters
A1st type in each tuplet
B2nd type in each tuplet
Template Parameters
A1st type in each tuplet
B2nd type in each tuplet
C3rd type in each tuplet

Member Function Documentation

◆ Add() [1/4]

virtual void Astra.Serialization.Tuplets< A, B, C >.Add ( System.Object  a,
System.Object  b 
)
inlinevirtual

Adds a Tuple using the given elements

Parameters
a1st element of the tuplet
b2nd element of the tuplet

◆ Add() [2/4]

virtual void Astra.Serialization.Tuplets< A, B, C >.Add ( System.Object  a,
System.Object  b,
System.Object  c 
)
inlinevirtual

Adds a Tuple using the given elements

Parameters
a1st element of the tuplet
b2nd element of the tuplet
c3rd element of the tuplet

◆ Add() [3/4]

virtual void Astra.Serialization.Tuplets< A, B, C >.Add ( Tuplet< A, B >  tuplet)
inlinevirtual

Adds a Tuple to the list

Parameters
tupletTuplet to add

◆ Add() [4/4]

virtual void Astra.Serialization.Tuplets< A, B, C >.Add ( Tuplet< A, B, C >  tuplet)
inlinevirtual

Adds a Tuple to the list

Parameters
tupletTuplet to add

◆ ContainsFirst()

virtual bool Astra.Serialization.Tuplets< A, B, C >.ContainsFirst ( a)
inlinevirtual

Whether the list contains a 1st element with the given value

Parameters
aValue to look for in the 1st element

◆ ContainsSecond()

virtual bool Astra.Serialization.Tuplets< A, B, C >.ContainsSecond ( b)
inlinevirtual

Whether the list contains a 2nd element with the given value

Parameters
bValue to look for in the 2nd element

◆ ContainsThird()

virtual bool Astra.Serialization.Tuplets< A, B, C >.ContainsThird ( c)
inlinevirtual

Whether the list contains a 3rd element with the given value

Parameters
cValue to look for in the 3rd element

◆ GetEnumerator() [1/3]

virtual IEnumerator Astra.Serialization.Tuplets< A, B, C >.GetEnumerator ( )
inlinevirtual

Retrieves a typed enumerator

Implements Astra.Serialization.ITuplets2T< A, B >.

Reimplemented in Astra.Asset.SubmeshTexMap.

◆ GetEnumerator() [2/3]

new IEnumerator< T > Astra.Serialization.Tuplets< A, B, C >.GetEnumerator ( )
inline

◆ GetEnumerator() [3/3]

virtual IEnumerator Astra.Serialization.Tuplets< A, B, C >.GetEnumerator ( )
inlinevirtual

Retrieves a typed enumerator

Implements Astra.Serialization.ITuplets2T< A, B >.

Reimplemented in Astra.Asset.SubmeshTexMap.

◆ GetEnumeratorGeneric() [1/2]

IEnumerator Astra.Serialization.Tuplets< A, B, C >.GetEnumeratorGeneric ( )
inline

Retrieves a generic enumerator

Implements Astra.Serialization.ITuplets2.

◆ GetEnumeratorGeneric() [2/2]

IEnumerator Astra.Serialization.Tuplets< A, B, C >.GetEnumeratorGeneric ( )
inline

Retrieves a generic enumerator

Implements Astra.Serialization.ITuplets2.

◆ GetFirstType()

System.Type Astra.Serialization.Tuplets< A, B, C >.GetFirstType ( )
inline

◆ GetFromFirst() [1/2]

Tuplet< A, B > Astra.Serialization.Tuplets< A, B, C >.GetFromFirst ( a)
inline

Finds a tuplet, using the 1st element

Parameters
aValue of the 1st element to look for

◆ GetFromFirst() [2/2]

Tuplet< A, B, C > Astra.Serialization.Tuplets< A, B, C >.GetFromFirst ( a)
inline

Retrieve the Tuplet by 1st element value

Parameters
aValue to look for in the 1st element

◆ GetFromSecond() [1/2]

Tuplet< A, B > Astra.Serialization.Tuplets< A, B, C >.GetFromSecond ( b)
inline

Finds a tuplet, using the 2nd element

Parameters
bValue of the 2nd element to look for

◆ GetFromSecond() [2/2]

Tuplet< A, B, C > Astra.Serialization.Tuplets< A, B, C >.GetFromSecond ( b)
inline

Retrieve the Tuplet by 2nd element value

Parameters
bValue to look for in the 2nd element

◆ GetFromSlot() [1/2]

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

Retrieves the tuplet at the given index

Parameters
slotIndex to retrieve

Implements Astra.Serialization.ITuplets2T< A, B >.

◆ GetFromSlot() [2/2]

virtual Tuplet< A, B, C > Astra.Serialization.Tuplets< A, B, C >.GetFromSlot ( int  slot)
inlinevirtual

Retrieves the Tuplet at the given index

Parameters
slotIndex of the tuplet to retrieve

Implements Astra.Serialization.ITuplets2T< A, B >.

◆ GetFromSlot< R >()

R Astra.Serialization.Tuplets< A, B, C >.GetFromSlot< R > ( int  slot)
inline

Yields a tuplet back as the T type Warning: this gives you a COPY of the original, not a reference to the original! If you modify your result, you must re-upsert back in!

Parameters
slotThe slot you want to fetch
Template Parameters
T
Returns
Type Constraints
R :T 
R :new() 

◆ GetFromSlotGeneric() [1/2]

Tuplet< System.Object, System.Object > Astra.Serialization.Tuplets< A, B, C >.GetFromSlotGeneric ( int  slot)
inline

Retrieve a generic tuplet from the given index

Parameters
slotIndex of the tuplet to retrieve

Implements Astra.Serialization.ITuplets2.

◆ GetFromSlotGeneric() [2/2]

Tuplet< System.Object, System.Object, System.Object > Astra.Serialization.Tuplets< A, B, C >.GetFromSlotGeneric ( int  slot)
inline

Retrieve a generic tuplet from the given index

Parameters
slotIndex of the tuplet to retrieve

Implements Astra.Serialization.ITuplets2.

◆ GetFromThird()

Tuplet< A, B, C > Astra.Serialization.Tuplets< A, B, C >.GetFromThird ( c)
inline

Retrieve the Tuplet by 3rd element value

Parameters
cValue to look for in the 3rd element

◆ GetSecondType()

System.Type Astra.Serialization.Tuplets< A, B, C >.GetSecondType ( )
inline

◆ GetSlotFromFirst() [1/2]

int Astra.Serialization.Tuplets< A, B, C >.GetSlotFromFirst ( a)
inline

Find the index of the Tuplet by 1st element value

Parameters
aValue to look for in the 1st element

◆ GetSlotFromFirst() [2/2]

int Astra.Serialization.Tuplets< A, B, C >.GetSlotFromFirst ( a)
inline

Find the index of the Tuplet by 1st element value

Parameters
aValue to look for in the 1st element

◆ GetSlotFromSecond() [1/2]

int Astra.Serialization.Tuplets< A, B, C >.GetSlotFromSecond ( b)
inline

Find the index of the Tuplet by 2nd element value

Parameters
bValue to look for in the 2nd element

◆ GetSlotFromSecond() [2/2]

int Astra.Serialization.Tuplets< A, B, C >.GetSlotFromSecond ( b)
inline

Find the index of the Tuplet by 2nd element value

Parameters
bValue to look for in the 2nd element

◆ GetSlotFromThird()

int Astra.Serialization.Tuplets< A, B, C >.GetSlotFromThird ( c)
inline

Find the index of the Tuplet by 3rd element value

Parameters
cValue to look for in the 3rd element

◆ GetThirdType()

System.Type Astra.Serialization.Tuplets< A, B, C >.GetThirdType ( )
inline

◆ ReindexAdd()

void Astra.Serialization.Tuplets< A, B, C >.ReindexAdd ( Tuplet< A, B >  record)
inline

A more efficient way to index the tuplet lookups knowing we just added to the list

Parameters
recordTuplet just added

◆ RemoveByFirst()

virtual void Astra.Serialization.Tuplets< A, B, C >.RemoveByFirst ( a)
inlinevirtual

Removes the tuplet with the given 1st element value

Parameters
aValue of the 1st element

◆ RemoveBySecond()

virtual void Astra.Serialization.Tuplets< A, B, C >.RemoveBySecond ( b)
inlinevirtual

Removes the tuplet with the given 2nd element value

Parameters
bValue of the 2nd element

◆ RemoveBySlot() [1/2]

virtual void Astra.Serialization.Tuplets< A, B, C >.RemoveBySlot ( int  slot,
bool  reindex = false 
)
inlinevirtual

Removes a tuplet at the given index

Parameters
slotIndex of tuplet to remove
reindexWhether the tuplet list should be reindexed after this operation

Implements Astra.Serialization.ITuplets2.

◆ RemoveBySlot() [2/2]

virtual void Astra.Serialization.Tuplets< A, B, C >.RemoveBySlot ( int  slot,
bool  reindex = true 
)
inlinevirtual

Removes a tuplet at the given index

Parameters
slotIndex of tuplet to remove
reindexWhether the tuplet list should be reindexed after this operation

Implements Astra.Serialization.ITuplets2.

◆ RemoveFromFirst()

virtual bool Astra.Serialization.Tuplets< A, B, C >.RemoveFromFirst ( a)
inlinevirtual

Removes the tuplet with the given 1st element value

Parameters
aValue of the 1st element

◆ RemoveFromSecond()

virtual bool Astra.Serialization.Tuplets< A, B, C >.RemoveFromSecond ( b)
inlinevirtual

Removes the tuplet with the given 2nd element value

Parameters
bValue of the 2nd element

◆ RemoveFromThird()

virtual bool Astra.Serialization.Tuplets< A, B, C >.RemoveFromThird ( c)
inlinevirtual

Removes the tuplet with the given 3rd element value

Parameters
cValue of the 3rd element

◆ Upsert() [1/2]

void Astra.Serialization.Tuplets< A, B, C >.Upsert ( Tuplet< A, B >  tuplet)
inline

Adds the given tuplet into the list if it is not there, updates it if it is

Parameters
tupletTuplet to be added/updated

◆ Upsert() [2/2]

void Astra.Serialization.Tuplets< A, B, C >.Upsert ( Tuplet< A, B, C >  tuplet)
inline

Adds or updates the given tuplet in the list

Parameters
tupletTuplet to add/update

◆ UpsertBySlot() [1/6]

virtual void Astra.Serialization.Tuplets< A, B, C >.UpsertBySlot ( int  slot,
a,
b 
)
inlinevirtual

Adds or updates an entry, using typed values. Replaces an entry by slot, not by key/values

Parameters
slotIndex of the tuple to create/replace
a1st element in the Tuplet to create
b2nd element in the Tuplet to create

Implements Astra.Serialization.ITuplets2T< A, B >.

◆ UpsertBySlot() [2/6]

virtual void Astra.Serialization.Tuplets< A, B, C >.UpsertBySlot ( int  slot,
a,
b,
c 
)
inlinevirtual

Adds or updates an entry, using typed values. Replaces an entry by slot, not by key/values

Parameters
slotIndex of the tuple to create/replace
a1st element in the Tuplet to create
b2nd element in the Tuplet to create
c3rd element in the Tuplet to create

Implements Astra.Serialization.ITuplets3T< A, B, C >.

◆ UpsertBySlot() [3/6]

virtual void Astra.Serialization.Tuplets< A, B, C >.UpsertBySlot ( int  slot,
System.Object  a,
System.Object  b 
)
inlinevirtual

Adds or updates an entry, using generic values. Replaces an entry by slot, not by key/values

Parameters
slotIndex of the tuple to create/replace
a1st element in the Tuplet to create
b2nd element in the Tuplet to create

Implements Astra.Serialization.ITuplets2.

◆ UpsertBySlot() [4/6]

virtual void Astra.Serialization.Tuplets< A, B, C >.UpsertBySlot ( int  slot,
System.Object  a,
System.Object  b,
System.Object  c 
)
inlinevirtual

Adds or updates an entry, using generic values. Replaces an entry by slot, not by key/values

Parameters
slotIndex of the tuple to create/replace
a1st element in the Tuplet to create
b2nd element in the Tuplet to create
c3rd element in the Tuplet to create

Implements Astra.Serialization.ITuplets3.

◆ UpsertBySlot() [5/6]

virtual void Astra.Serialization.Tuplets< A, B, C >.UpsertBySlot ( int  slot,
Tuplet< A, B >  tuplet 
)
inlinevirtual

Adds or updates an entry, using a passed in tuplet. Replaces an entry by slot, not by key/values

Parameters
slotIndex of the tuple to create/replace
tupletTuplet to create/replace

◆ UpsertBySlot() [6/6]

virtual void Astra.Serialization.Tuplets< A, B, C >.UpsertBySlot ( int  slot,
Tuplet< A, B, C >  tuplet 
)
inlinevirtual

Adds or updates an entry, using a passed in tuplet. Replaces an entry by slot, not by key/values

Parameters
slotIndex of the tuple to create/replace
tupletTuplet to create/replace

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