Click or drag to resize
AlgorithmsRandomShuffleT Method (IEnumerableT, Random)
Randomly shuffles the items in a collection, yielding a new collection.

Namespace: X3Platform.Collections
Assembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntax
public static T[] RandomShuffle<T>(
	IEnumerable<T> collection,
	Random randomGenerator
)

Parameters

collection
Type: System.Collections.GenericIEnumerableT
The collection to shuffle.
randomGenerator
Type: SystemRandom
The random number generator to use to select the random order.

Type Parameters

T
The type of the items in the collection.

Return Value

Type: T
An array with the same size and items as collection, but the items in a randomly chosen order.
See Also