Interface IDataSet
Set that contains items with a ID and name.
Namespace: InsaneScatterbrain.ScriptGraph
Syntax
public interface IDataSet
Properties
Names
Gets the item names.
Declaration
IReadOnlyCollection<string> Names { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyCollection<T><string> |
OrderedIds
Gets the item IDs in the order they are stored in the set.
Declaration
ReadOnlyCollection<string> OrderedIds { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.ReadOnlyCollection<T><string> |
Methods
ContainsId(string)
Gets whether the data set contains an item with the given ID.
Declaration
bool ContainsId(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID. |
Returns
Type | Description |
---|---|
bool | True if the item exists in the data set, false otherwise. |
ContainsName(string)
Gets whether the data set contains an item with the given name.
Declaration
bool ContainsName(string elementName)
Parameters
Type | Name | Description |
---|---|---|
string | elementName | The name. |
Returns
Type | Description |
---|---|
bool | True if the item exists in the data set, false otherwise. |
GetName(string)
Gets the name of an item with the given ID.
Declaration
string GetName(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID. |
Returns
Type | Description |
---|---|
string | The name. |
Move(string, int)
Moves the item with the given ID to another index in the set.
Declaration
void Move(string id, int newIndex)
Parameters
Type | Name | Description |
---|---|---|
string | id | The item's ID. |
int | newIndex | The new index. |
Remove(string)
Remove the item with the given ID from the set.
Declaration
void Remove(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID to remove. |
Rename(string, string)
Renames the item with the given ID.
Declaration
void Rename(string id, string newName)
Parameters
Type | Name | Description |
---|---|---|
string | id | The item's ID. |
string | newName | The item's new name. |
Events
OnAdded
Event triggered whenever an item is added to the set.
Declaration
event Action<string> OnAdded
Event Type
Type | Description |
---|---|
System.Action<T><string> |
OnMoved
Event triggered whenever an item is moved from one position to another within the set.
Declaration
event Action<int, int> OnMoved
Event Type
Type | Description |
---|---|
System.Action<T1, T2><int, int> |
OnRemoved
Event triggered whenever an item is removed from the set.
Declaration
event Action<string, string> OnRemoved
Event Type
Type | Description |
---|---|
System.Action<T1, T2><string, string> |
OnRenamed
Event triggered whenever an item in the set is renamed.
Declaration
event Action<string, string, string> OnRenamed
Event Type
Type | Description |
---|---|
System.Action<T1, T2, T3><string, string, string> |