Api Sandbox NetList<T>
class

NetList<T>

public sealed class NetList<T>

A networkable list for use with the SyncAttribute and 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&lt;int&gt; MyIntegerList { get; set; } = new(); public void AddNumber( int number ) { if ( IsProxy ) return; MyIntegerList.Add( number ); } }

Constructors

NetList<T>()

Properties

Name Type Description
Count virtual Int32
Item virtual T

Methods

virtual Void Dispose()
virtual Void Clear()

virtual Boolean Contains(T item)
virtual Void CopyTo(T[] array, Int32 arrayIndex)
virtual Void Add(T value)
Void AddRange(IEnumerable<T> collection)
Boolean Remove(T value)
virtual Int32 IndexOf(T item)
virtual Void Insert(Int32 index, T value)
virtual Void RemoveAt(Int32 index)

virtual IEnumerator<T> GetEnumerator()

Fields

Name Type Description
OnChanged NetListChangeEvent<T>> Get notified when the list has changed.
Assembly: Sandbox.Engine Namespace: Sandbox Full Name: Sandbox.NetList<T>