Dictionary used to manage Astra Items by key/value.
More...
|
|
| ItemDict () |
| | Constructor for an ItemDict, creates an empty one
|
| |
| void | Add (string _gid, ItemBase _item, bool replace=false) |
| | Adds an item to the dictionary More...
|
| |
| void | Remove (string _gid, bool refreshIndexes=true) |
| | Removes the item with the given id More...
|
| |
| bool | ContainsKey (string _gid) |
| | Whether the dictionary contains an item of this id More...
|
| |
| bool | ContainsValue (ItemBase _val) |
| | Whether the dictionary contains this item More...
|
| |
| ItemBase | Get (string _gid) |
| | Gets the item of the given id More...
|
| |
| T | Get< T > (string _gid, bool warnIfMissing=false) |
| | Templated get for an item More...
|
| |
| T | Pop< T > (string _gid, bool refreshIndexes=true) |
| | Gets the item from the dictionary and removes it in the same call More...
|
| |
| int | GetIndex (string _gid) |
| | Finds the index for the item with the given id More...
|
| |
| T | GetItemAtIndex< T > (int _indx) |
| | Retrieves the item at the given index More...
|
| |
|
void | Clear () |
| | Clears the dictionary
|
| |
|
void | RebuildIndexes () |
| | Sets up indexes for keys in dictionary for quick lookup
|
| |
|
void | OnBeforeSerialize () |
| | Implementation of method in Unity's ISerializationCallbackReceiver
|
| |
|
void | OnAfterDeserialize () |
| | Implementation of method in Unity's ISerializationCallbackReceiver
|
| |
|
|
List< string > | Keys |
| | List of keys
|
| |
|
List< ItemBase > | Values |
| | List of values
|
| |
|
|
void | UpdateRefreshKeysToSlotAfterSlot (int slot) |
| |
Dictionary used to manage Astra Items by key/value.
◆ Add()
| void Astra.Serialization.ItemDict.Add |
( |
string |
_gid, |
|
|
ItemBase |
_item, |
|
|
bool |
replace = false |
|
) |
| |
|
inline |
Adds an item to the dictionary
- Parameters
-
| _gid | Id of the item |
| _item | Item instance |
| replace | Whether the item should replace an existing item |
◆ ContainsKey()
| bool Astra.Serialization.ItemDict.ContainsKey |
( |
string |
_gid | ) |
|
|
inline |
Whether the dictionary contains an item of this id
- Parameters
-
| _gid | Id of item to look for |
◆ ContainsValue()
| bool Astra.Serialization.ItemDict.ContainsValue |
( |
ItemBase |
_val | ) |
|
|
inline |
Whether the dictionary contains this item
- Parameters
-
◆ Get()
| ItemBase Astra.Serialization.ItemDict.Get |
( |
string |
_gid | ) |
|
|
inline |
Gets the item of the given id
- Parameters
-
| _gid | Id of item to retrieve |
◆ Get< T >()
Templated get for an item
- Template Parameters
-
| T | Type of item to be retrieved. Must derive from ItemBase |
- Parameters
-
| _gid | Id of the item to retrieve |
| warnIfMissing | Whether a log statement should be made if the item is not there |
◆ GetIndex()
| int Astra.Serialization.ItemDict.GetIndex |
( |
string |
_gid | ) |
|
|
inline |
Finds the index for the item with the given id
- Parameters
-
- Returns
◆ GetItemAtIndex< T >()
| T Astra.Serialization.ItemDict.GetItemAtIndex< T > |
( |
int |
_indx | ) |
|
|
inline |
Retrieves the item at the given index
- Template Parameters
-
| T | Type of item to be retrieved. Must derive from ItemBase |
- Parameters
-
◆ Pop< T >()
| T Astra.Serialization.ItemDict.Pop< T > |
( |
string |
_gid, |
|
|
bool |
refreshIndexes = true |
|
) |
| |
|
inline |
Gets the item from the dictionary and removes it in the same call
- Template Parameters
-
| T | Type of item to be retrieved. Must derive from ItemBase |
- Parameters
-
| _gid | Id of the item to retrieve |
| refreshIndexes | Whether indexes should be refreshed after pop action |
◆ Remove()
| void Astra.Serialization.ItemDict.Remove |
( |
string |
_gid, |
|
|
bool |
refreshIndexes = true |
|
) |
| |
|
inline |
Removes the item with the given id
- Parameters
-
| _gid | Id of item to remove |
| refreshIndexes | Whether index list should be refreshed after removal |
◆ this[string _gid]
| ItemBase Astra.Serialization.ItemDict.this[string _gid] |
|
getset |
Sets or gets the item using this id
- Parameters
-
The documentation for this class was generated from the following file:
- Assets/Astra/Serialization/ItemDict.cs