Class NamedColorSet
Set of named colors.
Inheritance
Inherited Members
Namespace: InsaneScatterbrain.MapGraph
Syntax
public class NamedColorSet : DataSetScriptableObject<NamedColor>, IVersioned, IDataSet<NamedColor>, IDataSet, ISerializationCallbackReceiver
Properties
LinkedSets
Declaration
public ReadOnlyCollection<IDataSet> LinkedSets { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollection<IDataSet> |
OpenSet
Gets the less restricted set of items for protected use.
Declaration
protected override IOpenDataSet<NamedColor> OpenSet { get; }
Property Value
Type | Description |
---|---|
IOpenDataSet<NamedColor> |
Overrides
Methods
Add(NamedColor)
Adds an item to the dataset.
Declaration
public override void Add(NamedColor element)
Parameters
Type | Name | Description |
---|---|---|
NamedColor | element | The item to add. |
Overrides
ContainsColor(Color32)
Gets whether the color is defined inside the set.
Declaration
public bool ContainsColor(Color32 color)
Parameters
Type | Name | Description |
---|---|---|
Color32 | color | The color. |
Returns
Type | Description |
---|---|
bool | True if the color exists inside the set, false otherwise. |
GetColorById(string)
Gets the color by ID.
Declaration
public Color32 GetColorById(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The named color's ID. |
Returns
Type | Description |
---|---|
Color32 | The color. |
GetColorByName(string)
Gets the color by name.
Declaration
public Color32 GetColorByName(string colorName)
Parameters
Type | Name | Description |
---|---|---|
string | colorName | The named color's name. |
Returns
Type | Description |
---|---|
Color32 | The color. |
GetColorLinkedSets(string)
Gets all the datasets that the given color ID is linked to.
Declaration
public IEnumerable<IDataSet> GetColorLinkedSets(string colorId)
Parameters
Type | Name | Description |
---|---|---|
string | colorId | The color ID. |
Returns
Type | Description |
---|---|
IEnumerable<IDataSet> | Readonly set of linked datasets. Null if there are none. |
GetId(string)
Declaration
public string GetId(string colorName)
Parameters
Type | Name | Description |
---|---|---|
string | colorName |
Returns
Type | Description |
---|---|
string |
GetName(Color32)
Gets the color name by color.
Declaration
public string GetName(Color32 color)
Parameters
Type | Name | Description |
---|---|---|
Color32 | color | The color. |
Returns
Type | Description |
---|---|
string | The color name. |
IsColorLinked(string)
Returns whether the given color ID is linked to any datasets.
Declaration
public bool IsColorLinked(string colorId)
Parameters
Type | Name | Description |
---|---|---|
string | colorId | The color's ID. |
Returns
Type | Description |
---|---|
bool | True if the color is linked to one or more datasets, false otherwise. |
IsLinked(IDataSet)
Gets whether the named color set is linked to the given dataset.
Declaration
public bool IsLinked(IDataSet set)
Parameters
Type | Name | Description |
---|---|---|
IDataSet | set | The dataset. |
Returns
Type | Description |
---|---|
bool | True if they're linked, false otherwise. |
IsManuallyCreated(string)
Declaration
public bool IsManuallyCreated(string colorId)
Parameters
Type | Name | Description |
---|---|---|
string | colorId |
Returns
Type | Description |
---|---|
bool |
Link(IDataSet)
Links the named color set to the given dataset.
Declaration
public void Link(IDataSet set)
Parameters
Type | Name | Description |
---|---|---|
IDataSet | set |
MarkManuallyCreated(string)
Declaration
public void MarkManuallyCreated(string colorId)
Parameters
Type | Name | Description |
---|---|---|
string | colorId |
OnAfterDeserialize()
Implement this method to receive a callback after Unity deserializes your object.
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Implement this method to receive a callback before Unity serializes your object.
Declaration
public void OnBeforeSerialize()
Remove(string)
Removes the color with the given name from the set.
Declaration
public override void Remove(string id)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID of the named color to remove. |
Overrides
SetColor(string, Color)
Declaration
public void SetColor(string id, Color newColor)
Parameters
Type | Name | Description |
---|---|---|
string | id | |
Color | newColor |
Unlink(IDataSet)
Unlinks the named color set from the given dataset.
Declaration
public void Unlink(IDataSet set)
Parameters
Type | Name | Description |
---|---|---|
IDataSet | set |
UnmarkManuallyCreated(string)
Declaration
public void UnmarkManuallyCreated(string colorId)
Parameters
Type | Name | Description |
---|---|---|
string | colorId |
Update()
Unlinks any sets that no longer exist.
Declaration
public void Update()