Table of Contents

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

array LinkedList<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

array LinkedList<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

array T[,]

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

list LinkedList<T>
item T

Returns

int

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

list LinkedList<T>

Returns

IEnumerable<LinkedListNode<T>>

Type Parameters

T

Remarks

Removing the current node ends the enumeration, since removing a node clears its Next link.