Fusion type for networking LinkedLists. Maximum capacity is fixed, and is set with the CapacityAttribute.
Typical Usage:
More...
Inherits IEnumerable< T >.
Public Member Functions | |
void | Add (T value) |
Adds a value to the end of the list. | |
void | Clear () |
Removes and clears all list elements. | |
bool | Contains (T value) |
Returns true if the value already exists in the list. | |
bool | Contains (T value, IEqualityComparer< T > comparer) |
Returns true if the value already exists in the list. | |
int * | Entry (int index) |
int * | FindFreeEntry (out int index) |
T | Get (int index) |
Returns the value at supplied index. | |
int * | GetEntryByListIndex (int listIndex) |
Enumerator | GetEnumerator () |
IEnumerator< T > IEnumerable< T >. | GetEnumerator () |
IEnumerator IEnumerable. | GetEnumerator () |
int | IndexOf (T value) |
Returns the index with this value. Returns -1 if not found. | |
int | IndexOf (T value, IEqualityComparer< T > equalityComparer) |
Returns the index with this value. Returns -1 if not found. | |
NetworkLinkedList (byte *data, int capacity, IElementReaderWriter< T > rw) | |
T | Read (int *entry) |
NetworkLinkedList< T > | Remap (void *list) |
bool | Remove (T value) |
Removes the first found element with indicated value. | |
bool | Remove (T value, IEqualityComparer< T > equalityComparer) |
Removes the first found element with indicated value. | |
void | RemoveEntry (int *entry, int entryIndex) |
T | Set (int index, T value) |
Sets the value at supplied index. | |
void | Write (int *entry, T value) |
Public Attributes | |
int | _capacity |
int * | _data |
IElementReaderWriter< T > | _rw |
int | _stride |
Properties | |
int | Capacity [get] |
Returns the max element count. | |
int | Count [get] |
Returns the current element count. | |
int | Head [get, set] |
int | Tail [get, set] |
T | this[int index] [get, set] |
Element indexer. | |
Fusion type for networking LinkedLists. Maximum capacity is fixed, and is set with the CapacityAttribute.
Typical Usage:
[Networked, Capacity(10)]
NetworkLinkedList<int> syncedLinkedList => default;
Optional usage (for NetworkBehaviours ONLY - this is not legal in INetworkStructs): [Networked, Capacity(4)]
NetworkLinkedList<int> syncedLinkedList { get; } = MakeInitializer(new int[] { 1, 2, 3, 4 });
Usage for modifying data: var list = syncedLinkedList; list.Add(123); list[0] = 456; list.Remove(0);
T | T can be a primitive, or an INetworkStruct. |
void Add | ( | T | value | ) |
Adds a value to the end of the list.
value |
int IndexOf | ( | T | value, |
IEqualityComparer< T > | equalityComparer | ||
) |
Returns the index with this value. Returns -1 if not found.
equalityComparer | Specify custom IEqualityComparer to be used for compare. |