Class EnumUtil
- Namespace
- ConfigurableWarning.API.Util
- Assembly
- RedstoneWizard08.ContentLibrary.dll
Utilities for enums.
public static class EnumUtil
- Inheritance
-
EnumUtil
- Inherited Members
Methods
GetIndex<T>(T)
Get an enum value's index/ordinal.
public static int GetIndex<T>(T value) where T : struct
Parameters
value
TThe enum value.
Returns
- int
The index of the value.
Type Parameters
T
GetOptions<T>()
Get the options for an enum.
public static string[] GetOptions<T>() where T : struct
Returns
- string[]
A list of names for the enum.
Type Parameters
T
Parse<T>(string)
Get an enum value by it's name.
public static T Parse<T>(string value) where T : struct
Parameters
value
stringThe name of the enum value.
Returns
- T
The enum value.
Type Parameters
T