mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-16 18:53:12 +01:00
16 lines
No EOL
429 B
C#
16 lines
No EOL
429 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace MLEM.Extensions {
|
|
public static class RandomExtensions {
|
|
|
|
public static T GetRandomEntry<T>(this Random random, params T[] entries) {
|
|
return entries[random.Next(entries.Length)];
|
|
}
|
|
|
|
public static T GetRandomEntry<T>(this Random random, IList<T> entries) {
|
|
return entries[random.Next(entries.Count)];
|
|
}
|
|
|
|
}
|
|
} |