Class DataCatalog
Provides a collection of data that is flexible and editable in the editor.
Implements
ISerializationCallbackReceiver
Assembly: cs.temp.dll.dll
Syntax
public class DataCatalog : ScriptableObject, ISerializationCallbackReceiver, IList<IEntry>, ICollection<IEntry>, IReadOnlyList<IEntry>, IReadOnlyCollection<IEntry>, IEnumerable<IEntry>, IEnumerable
Properties
Count
Declaration
public int Count { get; }
Property Value
Id
The identifier of catalog.
Declaration
public string Id { get; }
Property Value
Item[Int32]
Declaration
public IEntry this[int index] { get; set; }
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Property Value
Item[String]
Declaration
public IEntry this[string id] { get; }
Parameters
Type |
Name |
Description |
String |
id |
|
Property Value
Methods
Add(IEntry)
Add the entry to MackySoft.UniData.DataCatalog.Entries.
The addition failed if the specified entry is already contained in MackySoft.UniData.DataCatalog.Entries.
Declaration
public bool Add(IEntry entry)
Parameters
Type |
Name |
Description |
IEntry |
entry |
|
Returns
Type |
Description |
Boolean |
Whether the addition was successful.
|
Exceptions
Clear()
Declaration
ClearEntries()
Declaration
protected virtual void ClearEntries()
CopyTo(IEntry[], Int32)
Declaration
public void CopyTo(IEntry[] array, int arrayIndex)
Parameters
Create<T>(String)
Create the new catalog instance with specified id.
Declaration
public static T Create<T>(string id)
where T : DataCatalog
Parameters
Type |
Name |
Description |
String |
id |
The identifier of the catalog to be created.
|
Returns
Type Parameters
Create<T>(String, IEnumerable<IEntry>)
Create the new catalog instance with specified id.
Declaration
public static T Create<T>(string id, IEnumerable<IEntry> entries)
where T : DataCatalog
Parameters
Returns
Type Parameters
GetEntriesOfType<T>()
Get only entries of the specified type.
Declaration
public IEnumerable<T> GetEntriesOfType<T>()
Returns
Type Parameters
GetEntry(String)
Declaration
public IEntry GetEntry(string id)
Parameters
Type |
Name |
Description |
String |
id |
|
Returns
GetEntry<T>(String)
Declaration
public T GetEntry<T>(string id)
Parameters
Type |
Name |
Description |
String |
id |
|
Returns
Type Parameters
GetEnumerator()
Declaration
public IEnumerator<IEntry> GetEnumerator()
Returns
HasEntry(IEntry)
Whether the specified entry is contained in MackySoft.UniData.DataCatalog.Entries.
Declaration
public bool HasEntry(IEntry entry)
Parameters
Type |
Name |
Description |
IEntry |
entry |
|
Returns
Exceptions
HasEntry(String)
Whether the entry with the specified id is contained in MackySoft.UniData.DataCatalog.Entries.
Declaration
public bool HasEntry(string id)
Parameters
Type |
Name |
Description |
String |
id |
|
Returns
IndexOf(IEntry)
Declaration
public int IndexOf(IEntry entry)
Parameters
Type |
Name |
Description |
IEntry |
entry |
|
Returns
IndexOf(String)
Declaration
public int IndexOf(string id)
Parameters
Type |
Name |
Description |
String |
id |
|
Returns
Insert(Int32, IEntry)
Declaration
public void Insert(int index, IEntry entry)
Parameters
InsertEntry(Int32, IEntry)
Declaration
protected virtual void InsertEntry(int index, IEntry entry)
Parameters
Move(Int32, Int32)
Declaration
public void Move(int oldIndex, int newIndex)
Parameters
Type |
Name |
Description |
Int32 |
oldIndex |
|
Int32 |
newIndex |
|
MoveEntry(Int32, Int32)
Declaration
protected virtual void MoveEntry(int oldIndex, int newIndex)
Parameters
Type |
Name |
Description |
Int32 |
oldIndex |
|
Int32 |
newIndex |
|
Remove(IEntry)
Declaration
public bool Remove(IEntry entry)
Parameters
Type |
Name |
Description |
IEntry |
entry |
|
Returns
Remove(String)
Declaration
public bool Remove(string id)
Parameters
Type |
Name |
Description |
String |
id |
|
Returns
RemoveAt(Int32)
Declaration
public void RemoveAt(int index)
Parameters
Type |
Name |
Description |
Int32 |
index |
|
RemoveEntry(Int32)
Declaration
protected virtual void RemoveEntry(int index)
Parameters
Type |
Name |
Description |
Int32 |
index |
|
SetEntry(IEntry)
Set the entry to MackySoft.UniData.DataCatalog.Entries.
If an entry with the same id as the specified entry is already contained, specified entry is added after already contained entry is removed.
Declaration
public void SetEntry(IEntry entry)
Parameters
Type |
Name |
Description |
IEntry |
entry |
|
Exceptions
SetEntry(Int32, IEntry)
Declaration
protected virtual void SetEntry(int index, IEntry entry)
Parameters
TryGetEntry(String, out IEntry)
Declaration
public bool TryGetEntry(string id, out IEntry result)
Parameters
Returns
TryGetEntry<T>(String, out T)
Declaration
public bool TryGetEntry<T>(string id, out T result)
Parameters
Type |
Name |
Description |
String |
id |
|
T |
result |
|
Returns
Type Parameters
Implements
ISerializationCallbackReceiver