Skip to content

Mirror::SyncList

More...

Inherits from IList< T >, IReadOnlyList< T >, SyncObject

Public Classes

Name
struct Enumerator

Public Events

Name
SyncListChanged Callback()

Public Functions

Name
delegate void SyncListChanged(Operation op, int itemIndex, T oldItem, T newItem)
SyncList()
SyncList(IEqualityComparer< T > comparer)
SyncList(IList< T > objects, IEqualityComparer< T > comparer =null)
void Flush()
Discard all the queued changes
void Reset()
Resets the SyncObject so that it can be re-used
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 Add(T item)
void AddRange(IEnumerable< T > range)
void Clear()
bool Contains(T item)
void CopyTo(T [] array, int index)
int IndexOf(T item)
int FindIndex(Predicate< T > match)
T Find(Predicate< T > match)
List< T > FindAll(Predicate< T > match)
void Insert(int index, T item)
void InsertRange(int index, IEnumerable< T > range)
bool Remove(T item)
void RemoveAt(int index)
int RemoveAll(Predicate< T > match)
Enumerator GetEnumerator()

Public Properties

Name
bool IsReadOnly
T this[int i]

Public Attributes

Name
int Count
bool IsDirty

Detailed Description

template <T >
class Mirror::SyncList;

Public Events Documentation

event Callback

SyncListChanged Callback()

Public Functions Documentation

function SyncListChanged

delegate void SyncListChanged(
    Operation op,
    int itemIndex,
    T oldItem,
    T newItem
)

function SyncList

inline SyncList()

function SyncList

inline SyncList(
    IEqualityComparer< T > comparer
)

function SyncList

inline SyncList(
    IList< T > objects,
    IEqualityComparer< T > comparer =null
)

function Flush

void Flush()

Discard all the queued changes

Reimplements: Mirror::SyncObject::Flush

Consider the object fully synchronized with clients

function Reset

inline void Reset()

Resets the SyncObject so that it can be re-used

Reimplements: Mirror::SyncObject::Reset

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 Add

inline void Add(
    T item
)

function AddRange

inline void AddRange(
    IEnumerable< T > range
)

function Clear

inline void Clear()

function Contains

bool Contains(
    T item
)

function CopyTo

void CopyTo(
    T [] array,
    int index
)

function IndexOf

inline int IndexOf(
    T item
)

function FindIndex

inline int FindIndex(
    Predicate< T > match
)

function Find

inline T Find(
    Predicate< T > match
)

function FindAll

inline List< T > FindAll(
    Predicate< T > match
)

function Insert

inline void Insert(
    int index,
    T item
)

function InsertRange

inline void InsertRange(
    int index,
    IEnumerable< T > range
)

function Remove

inline bool Remove(
    T item
)

function RemoveAt

inline void RemoveAt(
    int index
)

function RemoveAll

inline int RemoveAll(
    Predicate< T > match
)

function GetEnumerator

Enumerator GetEnumerator()

Public Property Documentation

property IsReadOnly

bool IsReadOnly;

property this[int i]

T this[int i];

Public Attributes Documentation

variable Count

int Count => objects.Count;

variable IsDirty

bool IsDirty => changes.Count > 0;

Updated on 21 January 2021 at 10:00:07 UTC