Class SyncQueue<T>
- Namespace
- LiteEntitySystem.Extensions
- Assembly
- LiteEntitySystem.dll
public class SyncQueue<T> : SyncableFieldCustomRollback, IReadOnlyCollection<T>, IEnumerable<T>, ICollection, IEnumerable where T : unmanaged
Type Parameters
T
- Inheritance
-
objectSyncQueue<T>
- Implements
-
IEnumerable<T>
- Inherited Members
Properties
Count
Gets the number of elements in the collection.
public int Count { get; }
Property Value
- int
The number of elements in the collection.
IsSynchronized
Gets a value indicating whether access to the ICollection is synchronized (thread safe).
public bool IsSynchronized { get; }
Property Value
- bool
true if access to the ICollection is synchronized (thread safe); otherwise, false.
SyncRoot
Gets an object that can be used to synchronize access to the ICollection.
public object SyncRoot { get; }
Property Value
- object
An object that can be used to synchronize access to the ICollection.
Methods
AfterReadRPC()
protected override void AfterReadRPC()
BeforeReadRPC()
protected override void BeforeReadRPC()
Clear()
public void Clear()
Contains(T)
public bool Contains(T item)
Parameters
item
T
Returns
CopyTo(Array, int)
Copies the elements of the ICollection to an Array, starting at a particular Array index.
public void CopyTo(Array array, int index)
Parameters
array
ArrayThe one-dimensional Array that is the destination of the elements copied from ICollection. The Array must have zero-based indexing.
index
intThe zero-based index in
array
at which copying begins.
Exceptions
- ArgumentNullException
array
is null.- ArgumentOutOfRangeException
index
is less than zero.- ArgumentException
<code class="paramref">array</code> is multidimensional.
-or-
The number of elements in the source ICollection is greater than the available space fromindex
to the end of the destinationarray
.
-or-
The type of the source ICollection cannot be cast automatically to the type of the destinationarray
.
Dequeue()
public T Dequeue()
Returns
- T
Enqueue(T)
public void Enqueue(T item)
Parameters
item
T
GetEnumerator()
public Queue<T>.Enumerator GetEnumerator()
Returns
- Queue<T>.Enumerator
OnRollback()
protected override void OnRollback()
OnSyncRequested()
Method for executing RPCs containing initial sync data that need to be sent after entity creation to existing players or when new player connected
protected override void OnSyncRequested()
Peek()
public T Peek()
Returns
- T
RegisterRPC(ref SyncableRPCRegistrator)
protected override void RegisterRPC(ref SyncableRPCRegistrator r)
Parameters
TryDequeue(out T)
public bool TryDequeue(out T item)
Parameters
item
T
Returns
TryPeek(out T)
public bool TryPeek(out T item)
Parameters
item
T