Class DataSet<T>
Set that contains items with a ID and name.
Implements
ISerializationCallbackReceiver
Syntax
[Serializable]
public abstract class DataSet<T> : IDataSet<T>, IDataSet, ISerializationCallbackReceiver where T : IDataSetItem
Type Parameters
Name |
Description |
T |
The item type.
|
Properties
Names
Declaration
public IReadOnlyCollection<string> Names { get; }
Property Value
OrderedIds
Declaration
public ReadOnlyCollection<string> OrderedIds { get; }
Property Value
Methods
Add(T)
Adds an item to the dataset.
Declaration
public virtual void Add(T element)
Parameters
Type |
Name |
Description |
T |
element |
The item to add.
|
ChangeId(string, string)
Declaration
public void ChangeId(string oldId, string newId)
Parameters
ContainsId(string)
Declaration
public bool ContainsId(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
ContainsName(string)
Declaration
public bool ContainsName(string elementName)
Parameters
Type |
Name |
Description |
string |
elementName |
|
Returns
Get(string)
Declaration
protected T Get(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
GetByName(string)
Declaration
protected T GetByName(string elementName)
Parameters
Type |
Name |
Description |
string |
elementName |
|
Returns
GetName(string)
Declaration
public string GetName(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Returns
Move(string, int)
Declaration
public void Move(string id, int newIndex)
Parameters
OnAfterDeserialize()
Implement this method to receive a callback after Unity deserializes your object.
Declaration
public virtual void OnAfterDeserialize()
OnBeforeSerialize()
Implement this method to receive a callback before Unity serializes your object.
Declaration
public void OnBeforeSerialize()
Remove(string)
Declaration
public virtual void Remove(string id)
Parameters
Type |
Name |
Description |
string |
id |
|
Rename(string, string)
Declaration
public void Rename(string id, string newName)
Parameters
Events
OnAdded
Declaration
public event Action<string> OnAdded
Event Type
OnMoved
Declaration
public event Action<int, int> OnMoved
Event Type
OnRemoved
Declaration
public event Action<string, string> OnRemoved
Event Type
OnRenamed
Declaration
public event Action<string, string, string> OnRenamed
Event Type
Implements
UnityEngine.ISerializationCallbackReceiver