Class EnumerableExtensions
Extension methods for the System.Collections.Generic.IEnumerable<T> interface.
Inheritance
System.Object
EnumerableExtensions
Namespace: Cuemon.Collections.Generic
Assembly: Cuemon.Core.dll
Syntax
public static class EnumerableExtensions
Methods
| Improve this DocShuffle<T>(IEnumerable<T>)
Shuffles the specified source
like a deck of cards.
Declaration
public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> source)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | source | The elements to be shuffled in the randomization process. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | A sequence of |
Type Parameters
Name | Description |
---|---|
T |
Remarks
Fisher–Yates shuffle: https://en.wikipedia.org/wiki/Fisher–Yates_shuffle
Shuffle<T>(IEnumerable<T>, Func<Int32, Int32, Int32>)
Shuffles the specified source
like a deck of cards.
Declaration
public static IEnumerable<T> Shuffle<T>(this IEnumerable<T> source, Func<int, int, int> randomizer)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<T> | source | The elements to be shuffled in the randomization process. |
System.Func<System.Int32, System.Int32, System.Int32> | randomizer | The function delegate that will handle the randomization of |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | A sequence of |
Type Parameters
Name | Description |
---|---|
T |
Remarks
Fisher–Yates shuffle: https://en.wikipedia.org/wiki/Fisher–Yates_shuffle