1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-11 23:58:08 -05:00
Files
IW4M-Admin/SharedLibraryCore/Helpers/ParseEnum.cs
RaidMax 4ae3ee1683 abstract engine color codes to use (Color::<Color>) format to make codes more.
see pt6 parser and configs for example usages
2022-01-26 15:20:10 -06:00

21 lines
381 B
C#

using System;
namespace SharedLibraryCore.Helpers
{
public class ParseEnum<T>
{
public static T Get(string e, Type type)
{
try
{
return (T)Enum.Parse(type, e);
}
catch (Exception)
{
return (T)(Enum.GetValues(type).GetValue(0));
}
}
}
}