API ReferenceSandbox
public sealed class Sandbox.NetList<T>
A networkable list for use with the `Sandbox.SyncAttribute` and `Sandbox.HostSyncAttribute`. Only changes will be networked instead of sending the whole list every time, so it's more efficient. Example usage: public class MyComponent : Component { [Sync] public NetList MyIntegerList { get; set; } = new(); public void AddNumber( int number ) { if ( IsProxy ) return; MyIntegerList.Add( number ); } }
Constructors
Showing 1 constructors
public NetList<T>()
No results match this filter.
Methods
Showing 11 methods
public virtual sealed void Add(T value)
public void AddRange(System.Collections.Generic.IEnumerable`1<T> collection)
public virtual sealed void Clear()
public virtual sealed bool Contains(T item)
public virtual sealed void CopyTo(T[] array, int arrayIndex)
public virtual sealed void Dispose()
public virtual sealed System.Collections.Generic.IEnumerator`1<T> GetEnumerator()
public virtual sealed int IndexOf(T item)
public virtual sealed void Insert(int index, T value)
public bool Remove(T value)
public virtual sealed void RemoveAt(int index)
No results match this filter.
Properties
Showing 2 properties
public virtual sealed int Sandbox.NetList<T>.Count { get; set; }
public virtual sealed T Sandbox.NetList<T>.Item { get; set; }
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.NetList`1 |