PKHeX/PKHeX.Core/Util/RandUtil.cs
Evan Dixon 52c4fbbe97 Converted PKHeX.Core to .Net Standard
Refactored and rearranged things as needed to allow the change
2017-05-11 23:34:18 -05:00

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;
}
}
}
}