Class TypewriterDatabase
- Namespace
- Aarthificial.Typewriter
- Assembly
- Aarthificial.Typewriter.dll
public class TypewriterDatabase : ScriptableObject, ISerializationCallbackReceiver
- Inheritance
-
TypewriterDatabase
- Implements
- Inherited Members
-
Object.Destroy(Object)Object.DestroyImmediate(Object)Object.DestroyObject(Object)
Fields
Tables
public List<DatabaseTable> Tables
Field Value
Properties
Instance
public static TypewriterDatabase Instance { get; }
Property Value
Methods
AddEntry(DatabaseTable, BaseEntry)
public void AddEntry(DatabaseTable table, BaseEntry entry)
Parameters
table
DatabaseTableentry
BaseEntry
AddListener(EntryAction)
public void AddListener(TypewriterDatabase.EntryAction action)
Parameters
action
TypewriterDatabase.EntryAction
AddListener(int, EntryAction)
public void AddListener(int id, TypewriterDatabase.EntryAction action)
Parameters
id
intaction
TypewriterDatabase.EntryAction
AddTable(DatabaseTable, int)
public int AddTable(DatabaseTable table, int index = -1)
Parameters
table
DatabaseTableindex
int
Returns
Contains(int)
public bool Contains(int id)
Parameters
id
int
Returns
CreateEntry(DatabaseTable, Type)
public BaseEntry CreateEntry(DatabaseTable table, Type entryType)
Parameters
table
DatabaseTableentryType
Type
Returns
CreateLookup()
public void CreateLookup()
CreateLookupIfNecessary()
public void CreateLookupIfNecessary()
GetRelations(int)
public List<BaseEntry> GetRelations(int id)
Parameters
id
int
Returns
HasChangedSince(ref int)
public bool HasChangedSince(ref int change)
Parameters
change
int
Returns
MarkChange()
public void MarkChange()
MoveToTable(int, DatabaseTable)
public void MoveToTable(int id, DatabaseTable table)
Parameters
id
inttable
DatabaseTable
OnAfterDeserialize()
Implement this method to receive a callback after Unity deserializes your object.
public void OnAfterDeserialize()
OnBeforeSerialize()
Implement this method to receive a callback before Unity serializes your object.
public void OnBeforeSerialize()
OnEntryEvent(ITypewriterContext, BaseEntry)
public void OnEntryEvent(ITypewriterContext provider, BaseEntry entry)
Parameters
provider
ITypewriterContextentry
BaseEntry
RemoveEntry(BaseEntry)
public bool RemoveEntry(BaseEntry entry)
Parameters
entry
BaseEntry
Returns
RemoveEntry(int)
public bool RemoveEntry(int id)
Parameters
id
int
Returns
RemoveListener(EntryAction)
public void RemoveListener(TypewriterDatabase.EntryAction action)
Parameters
action
TypewriterDatabase.EntryAction
RemoveListener(int, EntryAction)
public void RemoveListener(int id, TypewriterDatabase.EntryAction action)
Parameters
id
intaction
TypewriterDatabase.EntryAction
RemoveTable(DatabaseTable)
public void RemoveTable(DatabaseTable table)
Parameters
table
DatabaseTable
TryGetEntry(int, out BaseEntry)
public bool TryGetEntry(int id, out BaseEntry entry)
Parameters
Returns
TryGetEntry<T>(int, out T)
public bool TryGetEntry<T>(int id, out T entry) where T : BaseEntry
Parameters
id
intentry
T
Returns
Type Parameters
T
TryGetTable(int, out DatabaseTable)
public bool TryGetTable(int id, out DatabaseTable table)
Parameters
id
inttable
DatabaseTable
Returns
TryGetTable<T>(int, out T)
public bool TryGetTable<T>(int id, out T table) where T : DatabaseTable
Parameters
id
inttable
T
Returns
Type Parameters
T
UpdateLookupIfExists()
public void UpdateLookupIfExists()