1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-16 18:53:12 +01:00
MLEM/MLEM/Extensions/RandomExtensions.cs

16 lines
429 B
C#
Raw Normal View History

2019-08-06 14:20:11 +02:00
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)];
}
}
}