mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-18 08:23:12 +00:00
24 lines
610 B
C#
24 lines
610 B
C#
using System;
|
|
|
|
namespace PKHeX
|
|
{
|
|
public partial class Util
|
|
{
|
|
internal static readonly Random rand = new Random();
|
|
internal static uint rnd32()
|
|
{
|
|
return (uint)rand.Next(1 << 30) << 2 | (uint)rand.Next(1 << 2);
|
|
}
|
|
internal 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;
|
|
}
|
|
}
|
|
}
|
|
}
|