Class NetworkLinkedList<T>
- Namespace
- Netick
- Assembly
- Netick.dll
A networked linked list collection. This is an ordered list meaning that the elements insertion order is maintained when iterating through the collection.
public sealed class NetworkLinkedList<T> : NetworkLinkedList, INetworkCollection, IEnumerable<T>, IEnumerable where T : unmanaged
Type Parameters
T
- Inheritance
-
NetworkLinkedList<T>
- Implements
-
IEnumerable<T>
- Inherited Members
Constructors
NetworkLinkedList(int)
public NetworkLinkedList(int capacity)
Parameters
capacityint
Properties
Count
Gets the number of items contained in the linked list.
public int Count { get; }
Property Value
Head
Gets the first node in the linked list.
public NetworkLinkedListNode<T> Head { get; }
Property Value
Nodes
Gets an enumerable collection of all nodes in the linked list.
public IEnumerable<NetworkLinkedListNode<T>> Nodes { get; }
Property Value
Tail
Gets the last node in the linked list.
public NetworkLinkedListNode<T> Tail { get; }
Property Value
Methods
Add(T)
Adds an item to the end of the linked list.
public bool Add(T item)
Parameters
itemTThe item to add.
Returns
- bool
True if the item was added; otherwise, false.
AddAfter(NetworkLinkedListNode<T>, T, out NetworkLinkedListNode<T>)
Adds an item after the specified node in the linked list.
public bool AddAfter(NetworkLinkedListNode<T> afterThisNode, T item, out NetworkLinkedListNode<T> addedNode)
Parameters
afterThisNodeNetworkLinkedListNode<T>The node after which to insert the new item.
itemTThe item to add.
addedNodeNetworkLinkedListNode<T>The node that was added.
Returns
- bool
True if the item was added; otherwise, false.
AddBefore(NetworkLinkedListNode<T>, T, out NetworkLinkedListNode<T>)
Adds an item before the specified node in the linked list.
public bool AddBefore(NetworkLinkedListNode<T> beforeThisNode, T item, out NetworkLinkedListNode<T> addedNode)
Parameters
beforeThisNodeNetworkLinkedListNode<T>The node before which to insert the new item.
itemTThe item to add.
addedNodeNetworkLinkedListNode<T>The node that was added.
Returns
- bool
True if the item was added; otherwise, false.
AddFirst(T, out NetworkLinkedListNode<T>)
Adds an item as the first node in the linked list.
public bool AddFirst(T item, out NetworkLinkedListNode<T> addedNode)
Parameters
itemTThe item to add.
addedNodeNetworkLinkedListNode<T>The node that was added.
Returns
- bool
True if the item was added; otherwise, false.
AddLast(T, out NetworkLinkedListNode<T>)
Adds an item as the last node in the linked list.
public bool AddLast(T item, out NetworkLinkedListNode<T> addedNode)
Parameters
itemTThe item to add.
addedNodeNetworkLinkedListNode<T>The node that was added.
Returns
- bool
True if the item was added; otherwise, false.
Clear()
Removes all items from the linked list.
public void Clear()
GetEnumerator()
public NetworkLinkedList<T>.Enumerator GetEnumerator()
Returns
GetNode(int)
public NetworkLinkedListNode<T> GetNode(int index)
Parameters
indexint
Returns
InternalInit(INetickNetworkScript, int*, int, int)
public override void InternalInit(INetickNetworkScript beh, int* state, int elementSizeWords, int flags)
Parameters
behINetickNetworkScriptstateint*elementSizeWordsintflagsint
InternalReset()
public override void InternalReset()
Remove(NetworkLinkedListNode<T>)
Removes the specified node from the linked list.
public bool Remove(NetworkLinkedListNode<T> node)
Parameters
nodeNetworkLinkedListNode<T>The node to remove.
Returns
- bool
True if the node was removed; otherwise, false.
Remove(T)
Removes the first occurrence of the specified item from the linked list.
public bool Remove(T item)
Parameters
itemTThe item to remove.
Returns
- bool
True if the item was removed; otherwise, false.