Class EnumExtensions
- Namespace
- RisingV.Shared.Extensions
- Assembly
- RisingV.Shared.dll
Provides extension methods for working with enums.
public static class EnumExtensions
- Inheritance
-
EnumExtensions
- Inherited Members
Methods
GetRandom<TEnum>(TEnum, Random)
Gets a random value from the enum type.
public static TEnum GetRandom<TEnum>(this TEnum e, Random random) where TEnum : struct, Enum
Parameters
e
TEnumThe enum instance to get a random value from.
random
RandomThe random number generator to use for selecting a random value.
Returns
- TEnum
A random value of the specified enum type.
Type Parameters
TEnum
The type of the enum, which must be a struct and an enum.