mirror of
https://github.com/edgegamers/Jailbreak.git
synced 2025-12-05 20:40:29 -08:00
* Reformat * Add cvar config for HNS * Add more HNS customization support * Add customizations to noscope * Remove unused class var * More tidying up * Remove config infra * Add configurability to C4 * Add contributing, add config explanation in readme
19 lines
464 B
C#
19 lines
464 B
C#
namespace Jailbreak.Public.Extensions;
|
|
|
|
public static class CollectionExtensions {
|
|
private static readonly Random RANDOM = new();
|
|
|
|
public static void Shuffle<T>(this IList<T> list) {
|
|
var n = list.Count;
|
|
while (n > 1) {
|
|
n--;
|
|
var k = RANDOM.Next(n + 1);
|
|
(list[k], list[n]) = (list[n], list[k]);
|
|
}
|
|
}
|
|
|
|
public static void Shuffle<T>(this IEnumerable<T> enumerable) {
|
|
var list = enumerable.ToList();
|
|
list.Shuffle();
|
|
}
|
|
} |