Skip to content

Mirror::SyncIDictionary

More...

Inherits from IDictionary< TKey, TValue >, SyncObject, IReadOnlyDictionary< TKey, TValue >

Inherited by SyncDictionary< TKey, TValue >

Public Events

Name
SyncDictionaryChanged Callback()

Public Functions

Name
delegate void SyncDictionaryChanged(Operation op, TKey key, TValue item)
void Reset()
Resets the SyncObject so that it can be re-used
void Flush()
Discard all the queued changes
SyncIDictionary(IDictionary< TKey, TValue > objects)
void OnSerializeAll(NetworkWriter writer)
Write a full copy of the object
void OnSerializeDelta(NetworkWriter writer)
Write the changes made to the object since last sync
void OnDeserializeAll(NetworkReader reader)
Reads a full copy of the object
void OnDeserializeDelta(NetworkReader reader)
Reads the changes made to the object since last sync
void Clear()
bool ContainsKey(TKey key)
bool Remove(TKey key)
bool TryGetValue(TKey key, out TValue value)
void Add(TKey key, TValue value)
void Add(KeyValuePair< TKey, TValue > item)
bool Contains(KeyValuePair< TKey, TValue > item)
void CopyTo(KeyValuePair< TKey, TValue > [] array, int arrayIndex)
bool Remove(KeyValuePair< TKey, TValue > item)
IEnumerator< KeyValuePair< TKey, TValue > > GetEnumerator()

Public Properties

Name
bool IsReadOnly
TValue this[TKey i]

Public Attributes

Name
int Count
bool IsDirty
ICollection< TKey > Keys
ICollection< TValue > Values

Protected Attributes

Name
readonly IDictionary< TKey, TValue > objects

Detailed Description

template <TKey ,
TValue >
class Mirror::SyncIDictionary;

Public Events Documentation

event Callback

SyncDictionaryChanged Callback()

Public Functions Documentation

function SyncDictionaryChanged

delegate void SyncDictionaryChanged(
    Operation op,
    TKey key,
    TValue item
)

function Reset

inline void Reset()

Resets the SyncObject so that it can be re-used

Reimplements: Mirror::SyncObject::Reset

function Flush

void Flush()

Discard all the queued changes

Reimplements: Mirror::SyncObject::Flush

Consider the object fully synchronized with clients

function SyncIDictionary

inline SyncIDictionary(
    IDictionary< TKey, TValue > objects
)

function OnSerializeAll

inline void OnSerializeAll(
    NetworkWriter writer
)

Write a full copy of the object

Parameters:

  • writer

Reimplements: Mirror::SyncObject::OnSerializeAll

function OnSerializeDelta

inline void OnSerializeDelta(
    NetworkWriter writer
)

Write the changes made to the object since last sync

Parameters:

  • writer

Reimplements: Mirror::SyncObject::OnSerializeDelta

function OnDeserializeAll

inline void OnDeserializeAll(
    NetworkReader reader
)

Reads a full copy of the object

Parameters:

  • reader

Reimplements: Mirror::SyncObject::OnDeserializeAll

function OnDeserializeDelta

inline void OnDeserializeDelta(
    NetworkReader reader
)

Reads the changes made to the object since last sync

Parameters:

  • reader

Reimplements: Mirror::SyncObject::OnDeserializeDelta

function Clear

inline void Clear()

function ContainsKey

bool ContainsKey(
    TKey key
)

function Remove

inline bool Remove(
    TKey key
)

function TryGetValue

bool TryGetValue(
    TKey key,
    out TValue value
)

function Add

inline void Add(
    TKey key,
    TValue value
)

function Add

void Add(
    KeyValuePair< TKey, TValue > item
)

function Contains

inline bool Contains(
    KeyValuePair< TKey, TValue > item
)

function CopyTo

inline void CopyTo(
    KeyValuePair< TKey, TValue > [] array,
    int arrayIndex
)

function Remove

inline bool Remove(
    KeyValuePair< TKey, TValue > item
)

function GetEnumerator

IEnumerator< KeyValuePair< TKey, TValue > > GetEnumerator()

Public Property Documentation

property IsReadOnly

bool IsReadOnly;

property this[TKey i]

TValue this[TKey i];

Public Attributes Documentation

variable Count

int Count => objects.Count;

variable IsDirty

bool IsDirty => changes.Count > 0;

variable Keys

ICollection< TKey > Keys => objects.Keys;

variable Values

ICollection< TValue > Values => objects.Values;

Protected Attributes Documentation

variable objects

readonly IDictionary< TKey, TValue > objects;

Updated on 24 January 2021 at 23:47:09 UTC