rename OpenRA.Support.Random aka XRandom to MersenneTwister
This commit is contained in:
5
OpenRA.Game/Exts.cs
Executable file → Normal file
5
OpenRA.Game/Exts.cs
Executable file → Normal file
@@ -14,6 +14,7 @@ using System.Drawing;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using OpenRA.Support;
|
||||
|
||||
namespace OpenRA
|
||||
{
|
||||
@@ -100,13 +101,13 @@ namespace OpenRA
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static T Random<T>(this IEnumerable<T> ts, Support.Random r)
|
||||
public static T Random<T>(this IEnumerable<T> ts, MersenneTwister r)
|
||||
{
|
||||
var xs = ts.ToArray();
|
||||
return xs[r.Next(xs.Length)];
|
||||
}
|
||||
|
||||
public static T RandomOrDefault<T>(this IEnumerable<T> ts, Support.Random r)
|
||||
public static T RandomOrDefault<T>(this IEnumerable<T> ts, MersenneTwister r)
|
||||
{
|
||||
if (!ts.Any())
|
||||
return default(T);
|
||||
|
||||
Reference in New Issue
Block a user