Project/02 - Engine/LittleBigEngine/Utils/RandomHelper.cs
/// <summary>
/// Returns a random value in a enum.
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="random"></param>
/// <returns></returns>
Returns a random value in a enum.
Returns a random value in a enum .
public static T NextEnum<T>(this Random random)
        {
            T[] values = (T[])Enum.GetValues(typeof(T));
            return values[random.Next(0, values.Length)];
        }
public static T NextEnum < T > ( this Random random ) { T [ ] values = ( T [ ] ) Enum . GetValues ( typeof ( T ) ) ; return values [ random . Next ( 0 , values . Length ) ] ; }
Returns a random value in a enum.
Returns a random value in a enum .
None
Random
this
random
None
typeparam
None