API ReferenceSandbox
NetDictionary<TKey,TValue>class
A networkable dictionary for use with the `Sandbox.SyncAttribute` and `Sandbox.HostSyncAttribute`. Only changes will be networked instead of sending the whole dictionary every time, so it's more efficient. Example usage: public class MyComponent : Component { [Sync] public NetDictionary MyBoolTable { get; set; } = new(); public void SetBoolState( string key, bool state ) { if ( IsProxy ) return; MyBoolTable[key] = state; } }
object→NetDictionary<TKey,TValue>
Constructors1
Showing 1 constructors
public NetDictionary<TKey,TValue>()
No results match this filter.
Methods11
Showing 11 methods
public virtual sealed void Clear()
Returns:
void—public virtual sealed bool Contains(System.Collections.Generic.KeyValuePair`2<TKey,TValue> item)
| Parameter | Type | Description |
|---|---|---|
| item | KeyValuePair<TKey,TValue> | — |
Returns:
bool—public virtual sealed bool ContainsKey(TKey key)
| Parameter | Type | Description |
|---|---|---|
| key | TKey | — |
Returns:
bool—public virtual sealed void CopyTo(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[] array, int arrayIndex)
| Parameter | Type | Description |
|---|---|---|
| array | KeyValuePair<TKey,TValue>[] | — |
| arrayIndex | int | — |
Returns:
void—public virtual sealed void Dispose()
Returns:
void—public virtual sealed System.Collections.Generic.IEnumerator`1<System.Collections.Generic.KeyValuePair`2<TKey,TValue>> GetEnumerator()
Returns:
IEnumerator<KeyValuePair<TKey,TValue>>—public virtual sealed bool TryGetValue(TKey key, TValue value)
| Parameter | Type | Description |
|---|---|---|
| key | TKey | — |
| value | TValue | — |
Returns:
bool—No results match this filter.
Properties4
Showing 4 properties
public virtual sealed int Sandbox.NetDictionary<TKey,TValue>.Count { get; set; }
Returns:
int—public virtual sealed TValue Sandbox.NetDictionary<TKey,TValue>.Item { get; set; }
Returns:
TValue—public virtual sealed System.Collections.Generic.ICollection`1<TKey> Sandbox.NetDictionary<TKey,TValue>.Keys { get; set; }
Returns:
ICollection<TKey>—public virtual sealed System.Collections.Generic.ICollection`1<TValue> Sandbox.NetDictionary<TKey,TValue>.Values { get; set; }
Returns:
ICollection<TValue>—No results match this filter.