s&box docs

public sealed class Sandbox.NetDictionary<TKey,TValue>

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; } }

Constructors

Showing 1 constructors

public NetDictionary<TKey,TValue>()

Methods

Showing 11 methods

public virtual sealed void Clear()

public virtual sealed bool Contains(System.Collections.Generic.KeyValuePair`2<TKey,TValue> item)

public virtual sealed bool ContainsKey(TKey key)

public virtual sealed void CopyTo(System.Collections.Generic.KeyValuePair`2<TKey,TValue>[] array, int arrayIndex)

public virtual sealed void Dispose()

public virtual sealed System.Collections.Generic.IEnumerator`1<System.Collections.Generic.KeyValuePair`2<TKey,TValue>> GetEnumerator()

public virtual sealed bool TryGetValue(TKey key, TValue value)

Properties

Showing 4 properties

public virtual sealed int Sandbox.NetDictionary<TKey,TValue>.Count { get; set; }

public virtual sealed TValue Sandbox.NetDictionary<TKey,TValue>.Item { get; set; }

public virtual sealed System.Collections.Generic.ICollection`1<TKey> Sandbox.NetDictionary<TKey,TValue>.Keys { get; set; }

public virtual sealed System.Collections.Generic.ICollection`1<TValue> Sandbox.NetDictionary<TKey,TValue>.Values { get; set; }

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.NetDictionary`2

On this page