Class NetworkSet<T>
Event based NetworkVariable container for syncing Sets
Inheritance
NetworkSet<T>
Assembly: Unity.Multiplayer.MLAPI.Runtime.dll
Syntax
public class NetworkSet<T> : ISet<T>, ICollection<T>, IEnumerable<T>, IEnumerable, INetworkVariable
Type Parameters
| Name |
Description |
| T |
The type for the set
|
Constructors
NetworkSet()
Creates a NetworkSet with the default value and settings
Declaration
NetworkSet(NetworkVariableSettings)
Creates a NetworkSet with the default value and custom settings
Declaration
public NetworkSet(NetworkVariableSettings settings)
Parameters
NetworkSet(NetworkVariableSettings, ISet<T>)
Creates a NetworkSet with a custom value and custom settings
Declaration
public NetworkSet(NetworkVariableSettings settings, ISet<T> value)
Parameters
| Type |
Name |
Description |
| NetworkVariableSettings |
settings |
The settings to use for the NetworkSet
|
| ISet<T> |
value |
The initial value to use for the NetworkSet
|
NetworkSet(ISet<T>)
Creates a NetworkSet with a custom value and the default settings
Declaration
public NetworkSet(ISet<T> value)
Parameters
| Type |
Name |
Description |
| ISet<T> |
value |
The initial value to use for the NetworkList
|
Fields
Settings
The settings for this container
Declaration
public readonly NetworkVariableSettings Settings
Field Value
Properties
Count
Declaration
public int Count { get; }
Property Value
IsReadOnly
Declaration
public bool IsReadOnly { get; }
Property Value
LastSyncedTime
Gets the last time the variable was synced
Declaration
public float LastSyncedTime { get; }
Property Value
Methods
CanClientRead(ulong)
Gets Whether or not a specific client can read to the varaible
Declaration
public bool CanClientRead(ulong clientId)
Parameters
| Type |
Name |
Description |
| ulong |
clientId |
The clientId of the remote client
|
Returns
| Type |
Description |
| bool |
Whether or not the client can read to the variable
|
CanClientWrite(ulong)
Gets Whether or not a specific client can write to the varaible
Declaration
public bool CanClientWrite(ulong clientId)
Parameters
| Type |
Name |
Description |
| ulong |
clientId |
The clientId of the remote client
|
Returns
| Type |
Description |
| bool |
Whether or not the client can write to the variable
|
Clear()
Declaration
Contains(T)
Declaration
public bool Contains(T item)
Parameters
| Type |
Name |
Description |
| T |
item |
|
Returns
CopyTo(T[], int)
Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
| Type |
Name |
Description |
| T[] |
array |
|
| int |
arrayIndex |
|
ExceptWith(IEnumerable<T>)
Declaration
public void ExceptWith(IEnumerable<T> other)
Parameters
GetChannel()
Returns the name of the channel to be used for syncing
Declaration
public NetworkChannel GetChannel()
Returns
| Type |
Description |
| NetworkChannel |
The name of the channel to be used for syncing
|
GetEnumerator()
Declaration
public IEnumerator<T> GetEnumerator()
Returns
IntersectWith(IEnumerable<T>)
Declaration
public void IntersectWith(IEnumerable<T> other)
Parameters
IsDirty()
Gets Whether or not the container is dirty
Declaration
Returns
| Type |
Description |
| bool |
Whether or not the container is dirty
|
IsProperSubsetOf(IEnumerable<T>)
Declaration
public bool IsProperSubsetOf(IEnumerable<T> other)
Parameters
Returns
IsProperSupersetOf(IEnumerable<T>)
Declaration
public bool IsProperSupersetOf(IEnumerable<T> other)
Parameters
Returns
IsSubsetOf(IEnumerable<T>)
Declaration
public bool IsSubsetOf(IEnumerable<T> other)
Parameters
Returns
IsSupersetOf(IEnumerable<T>)
Declaration
public bool IsSupersetOf(IEnumerable<T> other)
Parameters
Returns
Overlaps(IEnumerable<T>)
Declaration
public bool Overlaps(IEnumerable<T> other)
Parameters
Returns
ReadDelta(Stream, bool, ushort, ushort)
Reads delta from the reader and applies them to the internal value
Declaration
public void ReadDelta(Stream stream, bool keepDirtyDelta, ushort localTick, ushort remoteTick)
Parameters
| Type |
Name |
Description |
| Stream |
stream |
The stream to read the delta from
|
| bool |
keepDirtyDelta |
Whether or not the delta should be kept as dirty or consumed
|
| ushort |
localTick |
The local network tick at which this var was written, on the machine it was written
|
| ushort |
remoteTick |
The remote network tick at which this var was sent by the host
|
ReadField(Stream, ushort, ushort)
Reads the complete state from the reader and applies it
Declaration
public void ReadField(Stream stream, ushort localTick, ushort remoteTick)
Parameters
| Type |
Name |
Description |
| Stream |
stream |
The stream to read the state from
|
| ushort |
localTick |
The local network tick at which this var was written, on the machine it was written
|
| ushort |
remoteTick |
The remote network tick at which this var was sent by the host
|
Remove(T)
Declaration
public bool Remove(T item)
Parameters
| Type |
Name |
Description |
| T |
item |
|
Returns
ResetDirty()
Resets the dirty state and marks the variable as synced / clean
Declaration
SetEquals(IEnumerable<T>)
Declaration
public bool SetEquals(IEnumerable<T> other)
Parameters
Returns
SetNetworkBehaviour(NetworkBehaviour)
Sets NetworkBehaviour the container belongs to.
Declaration
public void SetNetworkBehaviour(NetworkBehaviour behaviour)
Parameters
| Type |
Name |
Description |
| NetworkBehaviour |
behaviour |
The behaviour the container behaves to
|
SymmetricExceptWith(IEnumerable<T>)
Declaration
public void SymmetricExceptWith(IEnumerable<T> other)
Parameters
UnionWith(IEnumerable<T>)
Declaration
public void UnionWith(IEnumerable<T> other)
Parameters
WriteDelta(Stream)
Writes the dirty changes, that is, the changes since the variable was last dirty, to the writer
Declaration
public void WriteDelta(Stream stream)
Parameters
| Type |
Name |
Description |
| Stream |
stream |
The stream to write the dirty changes to
|
WriteField(Stream)
Writes the complete state of the variable to the writer
Declaration
public void WriteField(Stream stream)
Parameters
| Type |
Name |
Description |
| Stream |
stream |
The stream to write the state to
|
Events
OnSetChanged
The callback to be invoked when the set gets changed
Declaration
public event NetworkSet<T>.OnSetChangedDelegate OnSetChanged
Event Type
Implements