Skip to main content

Unity.Netcode.NetworkList-1

Event based NetworkVariable container for syncing Lists

Inheritance#

System.Dynamic.ExpandoObject

System.Dynamic.ExpandoObject

System.Dynamic.ExpandoObject

Implements#

System.IDisposable

Inherited Members#

NetworkVariableBase.Initialize(NetworkBehaviour)

NetworkVariableBase.Name

NetworkVariableBase.ReadPerm

NetworkVariableBase.SetDirty(Boolean)

NetworkVariableBase.ShouldWrite(UInt64, Boolean)

NetworkVariableBase.CanClientRead(UInt64)

Object.Equals(Object)

Object.Equals(Object, Object)

Object.GetHashCode()

Object.GetType()

Object.MemberwiseClone()

Object.ReferenceEquals(Object, Object)

Object.ToString()

Namespace: System.Dynamic.ExpandoObject#
Assembly: MLAPI.dll#
Syntax#
public class NetworkList<T> : NetworkVariableBase, IDisposable where T : struct, IEquatable<T>
Type Parameters#
NameDescription
TThe type for the list

NetworkList()#

Creates a NetworkList with the default value and settings

Declaration#

public NetworkList()

NetworkList(IEnumerable\<T>)#

Creates a NetworkList with a custom value and the default settings

Declaration#

public NetworkList(IEnumerable<T> values)

Parameters#

TypeNameDescription
System.Collections.Generic.IEnumerable\<T>valuesThe initial value to use for the NetworkList

NetworkList(NetworkVariableReadPermission, IEnumerable\<T>)#

Creates a NetworkList with the default value and custom settings

Declaration#

public NetworkList(NetworkVariableReadPermission readPerm, IEnumerable<T> values)

Parameters#

TypeNameDescription
NetworkVariableReadPermissionreadPermThe read permission to use for the NetworkList
System.Collections.Generic.IEnumerable\<T>valuesThe initial value to use for the NetworkList

#

Count#

Declaration#

public int Count { get; }

Property Value#

TypeDescription
System.Int32

Item[Int32]#

Declaration#

public T this[int index] { get; set; }

Parameters#

TypeNameDescription
System.Int32index

Property Value#

TypeDescription
T

LastModifiedTick#

Declaration#

public int LastModifiedTick { get; }

Property Value#

TypeDescription
System.Int32

#

Add(T)#

Declaration#

public void Add(T item)

Parameters#

TypeNameDescription
Titem

Clear()#

Declaration#

public void Clear()

Contains(T)#

Declaration#

public bool Contains(T item)

Parameters#

TypeNameDescription
Titem

Returns#

TypeDescription
System.Boolean

Dispose()#

Declaration#

public override void Dispose()

Overrides#

NetworkVariableBase.Dispose()

GetEnumerator()#

Declaration#

public IEnumerator<T> GetEnumerator()

Returns#

TypeDescription
System.Collections.Generic.IEnumerator\<T>

IndexOf(T)#

Declaration#

public int IndexOf(T item)

Parameters#

TypeNameDescription
Titem

Returns#

TypeDescription
System.Int32

Insert(Int32, T)#

Declaration#

public void Insert(int index, T item)

Parameters#

TypeNameDescription
System.Int32index
Titem

IsDirty()#

Gets Whether or not the container is dirty

Declaration#

public override bool IsDirty()

Returns#

TypeDescription
System.BooleanWhether or not the container is dirty

Overrides#

NetworkVariableBase.IsDirty()

ReadDelta(FastBufferReader, Boolean)#

Reads delta from the reader and applies them to the internal value

Declaration#

public override void ReadDelta(FastBufferReader reader, bool keepDirtyDelta)

Parameters#

TypeNameDescription
FastBufferReaderreaderThe stream to read the delta from
System.BooleankeepDirtyDeltaWhether or not the delta should be kept as dirty or consumed

Overrides#

NetworkVariableBase.ReadDelta(FastBufferReader, Boolean)

ReadField(FastBufferReader)#

Reads the complete state from the reader and applies it

Declaration#

public override void ReadField(FastBufferReader reader)

Parameters#

TypeNameDescription
FastBufferReaderreaderThe stream to read the state from

Overrides#

NetworkVariableBase.ReadField(FastBufferReader)

Remove(T)#

Declaration#

public bool Remove(T item)

Parameters#

TypeNameDescription
Titem

Returns#

TypeDescription
System.Boolean

RemoveAt(Int32)#

Declaration#

public void RemoveAt(int index)

Parameters#

TypeNameDescription
System.Int32index

ResetDirty()#

Resets the dirty state and marks the variable as synced / clean

Declaration#

public override void ResetDirty()

Overrides#

NetworkVariableBase.ResetDirty()

WriteDelta(FastBufferWriter)#

Writes the dirty changes, that is, the changes since the variable was last dirty, to the writer

Declaration#

public override void WriteDelta(FastBufferWriter writer)

Parameters#

TypeNameDescription
FastBufferWriterwriterThe stream to write the dirty changes to

Overrides#

NetworkVariableBase.WriteDelta(FastBufferWriter)

WriteField(FastBufferWriter)#

Writes the complete state of the variable to the writer

Declaration#

public override void WriteField(FastBufferWriter writer)

Parameters#

TypeNameDescription
FastBufferWriterwriterThe stream to write the state to

Overrides#

NetworkVariableBase.WriteField(FastBufferWriter)

#

OnListChanged#

The callback to be invoked when the list gets changed

Declaration#

public event NetworkList<T>.OnListChangedDelegate OnListChanged

Event Type#

TypeDescription
NetworkList.OnListChangedDelegate\<>

Implements#

System.IDisposable