mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-16 09:08:02 +00:00
3f38b123a3
mostly renaming things, includes a little bit of added sugar and splitting methods to simplify the codebase. all methods are now PascalCase
24 lines
610 B
C#
24 lines
610 B
C#
using System;
|
|
|
|
namespace PKHeX.Core
|
|
{
|
|
public partial class Util
|
|
{
|
|
public static readonly Random Rand = new Random();
|
|
public static uint Rand32()
|
|
{
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
}
|