Rewrite round generation and add unit test

This commit is contained in:
Flamefire committed 2014-12-16 23:36:49 +01:00
1 parent 84e9163b96
commit 6d494b64b3
11 files changed
+240 -386

No files matched your search

+12
View File
@@ -178,6 +178,18 @@ namespace VocaluxeLib
rect.Z);
}
public static List<T> Shuffle<T>(this List<T> list)
{
for (int n = list.Count - 1; n >= 1; n--)
{
int k = CBase.Game.GetRandom(n);
T value = list[k];
list[k] = list[n];
list[n] = value;
}
return list;
}
public static Size GetSize(this Bitmap bmp)
{
return new Size(bmp.Width, bmp.Height);