Class SyncDict<TKey, TValue>
- Namespace
- LiteEntitySystem.Extensions
- Assembly
- LiteEntitySystem.dll
public class SyncDict<TKey, TValue> : SyncableFieldCustomRollback, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable where TKey : unmanaged where TValue : unmanaged
Type Parameters
TKeyTValue
- Inheritance
-
objectSyncDict<TKey, TValue>
- Implements
-
IEnumerable<KeyValuePair<TKey, TValue>>
- Inherited Members
Properties
Count
public int Count { get; }
Property Value
this[TKey]
public TValue this[TKey index] { get; set; }
Parameters
indexTKey
Property Value
- TValue
Keys
public Dictionary<TKey, TValue>.KeyCollection Keys { get; }
Property Value
- Dictionary<TKey, TValue>.KeyCollection
Values
public Dictionary<TKey, TValue>.ValueCollection Values { get; }
Property Value
- Dictionary<TKey, TValue>.ValueCollection
Methods
Add(TKey, TValue)
public void Add(TKey key, TValue value)
Parameters
keyTKeyvalueTValue
AfterReadRPC()
protected override void AfterReadRPC()
BeforeReadRPC()
protected override void BeforeReadRPC()
Clear()
public void Clear()
ContainsKey(TKey)
public bool ContainsKey(TKey key)
Parameters
keyTKey
Returns
ContainsValue(TValue)
public bool ContainsValue(TValue value)
Parameters
valueTValue
Returns
GetEnumerator()
public Dictionary<TKey, TValue>.Enumerator GetEnumerator()
Returns
- Dictionary<TKey, TValue>.Enumerator
OnRollback()
protected override void OnRollback()
OnSyncRequested()
Method for executing RPCs containing initial sync data that need to be sent after entity creation to existing players or when new player connected
protected override void OnSyncRequested()
RegisterRPC(ref SyncableRPCRegistrator)
protected override void RegisterRPC(ref SyncableRPCRegistrator r)
Parameters
Remove(TKey)
public bool Remove(TKey key)
Parameters
keyTKey
Returns
TryGetValue(TKey, out TValue)
public bool TryGetValue(TKey key, out TValue value)
Parameters
keyTKeyvalueTValue