mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-07 16:45:10 +00:00
GameServerScene
GameServerScene
This commit is contained in:
@@ -26,5 +26,14 @@ namespace TEngine
|
||||
}
|
||||
return (T)Enum.Parse(typeof(T), str);
|
||||
}
|
||||
|
||||
public static T Parse<T>(this string str)
|
||||
{
|
||||
if (!Enum.IsDefined(typeof(T), str))
|
||||
{
|
||||
return default(T);
|
||||
}
|
||||
return (T)Enum.Parse(typeof(T), str);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user