API ReferenceSandbox
NetList<T>class
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 ); } }
object→NetList<T>
Constructors1
Showing 1 constructors
public NetList<T>()
No results match this filter.
Methods11
Showing 11 methods
public virtual sealed void Add(T value)
| Parameter | Type | Description |
|---|---|---|
| value | T | — |
Returns:
void—public void AddRange(System.Collections.Generic.IEnumerable`1<T> collection)
| Parameter | Type | Description |
|---|---|---|
| collection | IEnumerable<T> | — |
Returns:
void—public virtual sealed void Clear()
Returns:
void—public virtual sealed bool Contains(T item)
| Parameter | Type | Description |
|---|---|---|
| item | T | — |
Returns:
bool—public virtual sealed void CopyTo(T[] array, int arrayIndex)
| Parameter | Type | Description |
|---|---|---|
| array | T[] | — |
| arrayIndex | int | — |
Returns:
void—public virtual sealed void Dispose()
Returns:
void—public virtual sealed System.Collections.Generic.IEnumerator`1<T> GetEnumerator()
Returns:
IEnumerator<T>—public virtual sealed int IndexOf(T item)
| Parameter | Type | Description |
|---|---|---|
| item | T | — |
Returns:
int—public virtual sealed void Insert(int index, T value)
| Parameter | Type | Description |
|---|---|---|
| index | int | — |
| value | T | — |
Returns:
void—public bool Remove(T value)
| Parameter | Type | Description |
|---|---|---|
| value | T | — |
Returns:
bool—public virtual sealed void RemoveAt(int index)
| Parameter | Type | Description |
|---|---|---|
| index | int | — |
Returns:
void—No results match this filter.
Properties2
Showing 2 properties
public virtual sealed int Sandbox.NetList<T>.Count { get; set; }
Returns:
int—public virtual sealed T Sandbox.NetList<T>.Item { get; set; }
Returns:
T—No results match this filter.