Class DetailedLocalizationTable<TEntry>
Provides common functionality for both string and asset tables.
Inheritance
DetailedLocalizationTable<TEntry>
Syntax
public abstract class DetailedLocalizationTable<TEntry> : LocalizationTable, IMetadataCollection, IComparable<LocalizationTable>, IDictionary<long, TEntry>, ISerializationCallbackReceiver where TEntry : TableEntry
Type Parameters
Properties
Count
The number of entries in this Table.
Declaration
public int Count { get; }
Property Value
IsReadOnly
Will always be false. Implemented because it is required by the System.Collections.IList interface.
Declaration
public bool IsReadOnly { get; }
Property Value
Item[Int64]
Get/Set a value using the specified key.
Declaration
public TEntry this[long key] { get; set; }
Parameters
Type |
Name |
Description |
Int64 |
key |
|
Property Value
Item[String]
Get/Set a value using the specified key name.
Declaration
public TEntry this[string keyName] { get; set; }
Parameters
Type |
Name |
Description |
String |
keyName |
|
Property Value
Values
All values in this table.
Declaration
public ICollection<TEntry> Values { get; }
Property Value
Type |
Description |
ICollection<TEntry> |
|
Methods
Add(KeyValuePair<Int64, TEntry>)
Adds the item value with the specified keyId.
Declaration
public void Add(KeyValuePair<long, TEntry> item)
Parameters
Type |
Name |
Description |
KeyValuePair<Int64, TEntry> |
item |
|
Add(Int64, TEntry)
Adds the entry with the specified keyId.
Declaration
public void Add(long keyId, TEntry value)
Parameters
Type |
Name |
Description |
Int64 |
keyId |
|
TEntry |
value |
|
AddEntry(Int64, String)
Add or update an entry in the table.
Declaration
public virtual TEntry AddEntry(long keyId, string localized)
Parameters
Returns
AddEntry(String, String)
Add or update an entry in the table.
Declaration
public TEntry AddEntry(string key, string localized)
Parameters
Returns
AddEntryFromReference(TableEntryReference, String)
Add or update an entry in the table.
Declaration
public TEntry AddEntryFromReference(TableEntryReference entryReference, string localized)
Parameters
Returns
CheckForMissingSharedTableDataEntries(MissingEntryAction)
Tables do not store the full information for an entry, instead they store just the Id of that entry which can then be referenced in SharedData.
It is possible that something may have caused an entry to be in the Table but missing from SharedData.
This will cause issues and often result in the entry being ignored. This will check for any entries that exist in the table but do not have an entry in SharedData.
Declaration
public IList<TEntry> CheckForMissingSharedTableDataEntries(MissingEntryAction action = MissingEntryAction.Nothing)
Parameters
Type |
Name |
Description |
MissingEntryAction |
action |
The action to take on the found missing entries.
|
Returns
Type |
Description |
IList<TEntry> |
The identified missing entries.
|
Clear()
Clear all entries in this table.
Declaration
Contains(KeyValuePair<Int64, TEntry>)
Returns true if the table contains the item.
Declaration
public bool Contains(KeyValuePair<long, TEntry> item)
Parameters
Type |
Name |
Description |
KeyValuePair<Int64, TEntry> |
item |
|
Returns
ContainsKey(Int64)
Returns true if the table contains an entry with the keyId.
Declaration
public bool ContainsKey(long keyId)
Parameters
Type |
Name |
Description |
Int64 |
keyId |
|
Returns
ContainsValue(String)
Returns true if the table contains an entry with the same value.
Declaration
public bool ContainsValue(string localized)
Parameters
Type |
Name |
Description |
String |
localized |
The value to check for in all table entries.
|
Returns
Type |
Description |
Boolean |
True if a match was found else false.
|
CopyTo(KeyValuePair<Int64, TEntry>[], Int32)
Copies the contents of the table into an array starting at the arrayIndex.
Declaration
public void CopyTo(KeyValuePair<long, TEntry>[] array, int arrayIndex)
Parameters
Type |
Name |
Description |
KeyValuePair<Int64, TEntry>[] |
array |
|
Int32 |
arrayIndex |
|
CreateEmpty(TableEntryReference)
Create an empty entry in the table at the specified entry.
Declaration
public override void CreateEmpty(TableEntryReference entryReference)
Parameters
Overrides
CreateTableEntry()
Returns a new instance of TEntry.
Declaration
public abstract TEntry CreateTableEntry()
Returns
GetEntry(Int64)
Returns the entry for the key id or null if one does not exist.
Declaration
public virtual TEntry GetEntry(long keyId)
Parameters
Type |
Name |
Description |
Int64 |
keyId |
|
Returns
GetEntry(String)
Returns the entry for the key or null if one does not exist.
Declaration
public TEntry GetEntry(string key)
Parameters
Type |
Name |
Description |
String |
key |
|
Returns
GetEntryFromReference(TableEntryReference)
Returns the entry reference or null if one does not exist.
Declaration
public TEntry GetEntryFromReference(TableEntryReference entryReference)
Parameters
Returns
GetEnumerator()
Return an enumerator for the entries in this table.
Declaration
public IEnumerator<KeyValuePair<long, TEntry>> GetEnumerator()
Returns
Type |
Description |
IEnumerator<KeyValuePair<Int64, TEntry>> |
|
Remove(KeyValuePair<Int64, TEntry>)
Remove the item from the table if it exists.
Declaration
public bool Remove(KeyValuePair<long, TEntry> item)
Parameters
Type |
Name |
Description |
KeyValuePair<Int64, TEntry> |
item |
|
Returns
Remove(Int64)
Remove the entry with the keyId.
Declaration
public bool Remove(long keyId)
Parameters
Type |
Name |
Description |
Int64 |
keyId |
|
Returns
RemoveEntry(Int64)
Remove an entry from the table if it exists.
Declaration
public virtual bool RemoveEntry(long keyId)
Parameters
Type |
Name |
Description |
Int64 |
keyId |
The key id to remove.
|
Returns
Type |
Description |
Boolean |
True if the entry was found and removed.
|
RemoveEntry(String)
Remove an entry from the table if it exists.
Declaration
public bool RemoveEntry(string key)
Parameters
Type |
Name |
Description |
String |
key |
The name of the key.
|
Returns
Type |
Description |
Boolean |
True if the entry was found and removed.
|
TryGetValue(Int64, out TEntry)
Find the entry, if it exists in the table.
Declaration
public bool TryGetValue(long keyId, out TEntry value)
Parameters
Type |
Name |
Description |
Int64 |
keyId |
|
TEntry |
value |
|
Returns
Type |
Description |
Boolean |
True if the entry was found.
|