Class SyncList<T>
Inherited Members
Namespace: LiteEntitySystem.Extensions
Assembly: LiteEntitySystem.dll
Syntax
public class SyncList<T> : SyncableField, ICollection<T>, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable where T : unmanaged
Type Parameters
Name | Description |
---|---|
T |
Constructors
SyncList()
Declaration
public SyncList()
SyncList(int)
Declaration
public SyncList(int capacity)
Parameters
Type | Name | Description |
---|---|---|
int | capacity |
Properties
Count
Gets the number of elements contained in the ICollection<T>.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int | The number of elements contained in the ICollection<T>. |
IsReadOnly
Gets a value indicating whether the ICollection<T> is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool | true if the ICollection<T> is read-only; otherwise, false. |
this[int]
Gets the element at the specified index in the read-only list.
Declaration
public T this[int index] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
int | index | The zero-based index of the element to get. |
Property Value
Type | Description |
---|---|
T | The element at the specified index in the read-only list. |
Methods
Add(T)
Adds an item to the ICollection<T>.
Declaration
public void Add(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The object to add to the ICollection<T>. |
Exceptions
Type | Condition |
---|---|
NotSupportedException | The ICollection<T> is read-only. |
AfterReadRPC()
Declaration
protected override void AfterReadRPC()
Overrides
BeforeReadRPC()
Declaration
protected override void BeforeReadRPC()
Overrides
Clear()
Removes all items from the ICollection<T>.
Declaration
public void Clear()
Exceptions
Type | Condition |
---|---|
NotSupportedException | The ICollection<T> is read-only. |
Contains(T)
Determines whether the ICollection<T> contains a specific value.
Declaration
public bool Contains(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The object to locate in the ICollection<T>. |
Returns
Type | Description |
---|---|
bool | true if |
CopyTo(T[], int)
Copies the elements of the ICollection<T> to an Array, starting at a particular Array index.
Declaration
public void CopyTo(T[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
T[] | array | The one-dimensional Array that is the destination of the elements copied from ICollection<T>. The Array must have zero-based indexing. |
int | arrayIndex | The zero-based index in |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
ArgumentOutOfRangeException |
|
ArgumentException | The number of elements in the source ICollection<T> is greater than the available space from |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<T> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<T> | An enumerator that can be used to iterate through the collection. |
IndexOf(T)
Declaration
public int IndexOf(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item |
Returns
Type | Description |
---|---|
int |
OnRollback()
Declaration
protected override void OnRollback()
Overrides
OnSyncRequested()
Declaration
protected override void OnSyncRequested()
Overrides
RegisterRPC(ref SyncableRPCRegistrator)
Declaration
protected override void RegisterRPC(ref SyncableRPCRegistrator r)
Parameters
Type | Name | Description |
---|---|---|
SyncableRPCRegistrator | r |
Overrides
Remove(T)
Removes the first occurrence of a specific object from the ICollection<T>.
Declaration
public bool Remove(T item)
Parameters
Type | Name | Description |
---|---|---|
T | item | The object to remove from the ICollection<T>. |
Returns
Type | Description |
---|---|
bool | true if |
Exceptions
Type | Condition |
---|---|
NotSupportedException | The ICollection<T> is read-only. |
RemoveAt(int)
Declaration
public void RemoveAt(int index)
Parameters
Type | Name | Description |
---|---|---|
int | index |
ToArray()
Declaration
public T[] ToArray()
Returns
Type | Description |
---|---|
T[] |