Class CollectionExtensions
- Namespace
- BSGameLib.Core
- Assembly
- BSGameLib.Core.dll
Extensions for LinkedList<T> and for flattening arrays of items.
public static class CollectionExtensions
- Inheritance
-
CollectionExtensions
- Inherited Members
Methods
Flatten<T>(LinkedList<T>[,])
Returns the items of every list in a two-dimensional array of lists, in array order, then list order.
public static T[] Flatten<T>(this LinkedList<T>[,] array)
Parameters
arrayLinkedList<T>[,]
Returns
- T[]
Type Parameters
T
Flatten<T>(LinkedList<T>[])
Returns the items of every list in an array, in array order, then list order.
public static T[] Flatten<T>(this LinkedList<T>[] array)
Parameters
arrayLinkedList<T>[]
Returns
- T[]
Type Parameters
T
Flatten<T>(T[,])
Returns the elements of a two-dimensional array as a one-dimensional array. The first index varies slowest.
public static T[] Flatten<T>(this T[,] array)
Parameters
arrayT[,]
Returns
- T[]
Type Parameters
T
IndexOf<T>(LinkedList<T>, T)
Returns the zero-based index of the first node whose value equals item,
or -1 if none does.
public static int IndexOf<T>(this LinkedList<T> list, T item)
Parameters
listLinkedList<T>itemT
Returns
Type Parameters
T
Nodes<T>(LinkedList<T>)
Enumerates the nodes of a linked list in order.
public static IEnumerable<LinkedListNode<T>> Nodes<T>(this LinkedList<T> list)
Parameters
listLinkedList<T>
Returns
Type Parameters
T
Remarks
Removing the current node ends the enumeration, since removing a node clears its Next link.