mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 13:58:33 +00:00
24 lines
609 B
C#
24 lines
609 B
C#
using System;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
public partial class Util
|
|
{
|
|
public static readonly Random rand = new Random();
|
|
public static uint rnd32()
|
|
{
|
|
return (uint)rand.Next(1 << 30) << 2 | (uint)rand.Next(1 << 2);
|
|
}
|
|
public static void Shuffle<T>(T[] array)
|
|
{
|
|
int n = array.Length;
|
|
for (int i = 0; i < n; i++)
|
|
{
|
|
int r = i + (int)(rand.NextDouble() * (n - i));
|
|
T t = array[r];
|
|
array[r] = array[i];
|
|
array[i] = t;
|
|
}
|
|
}
|
|
}
|
|
}
|