Compatibility fix
This commit is contained in:
parent
a5a10e60cb
commit
24a0af3d58
|
@ -4,6 +4,12 @@ namespace StardewModdingAPI.Framework.ModLoading.RewriteFacades;
|
|||
|
||||
public static class EnumMethods
|
||||
{
|
||||
public static string[] GetNames<TEnum>() where TEnum : struct, Enum
|
||||
{
|
||||
Type enumType = typeof(TEnum);
|
||||
return Enum.GetNames(enumType);
|
||||
}
|
||||
|
||||
public static bool IsDefined<TEnum>(TEnum value) where TEnum : struct, Enum
|
||||
{
|
||||
Type enumType = typeof(TEnum);
|
||||
|
|
|
@ -119,6 +119,7 @@ namespace StardewModdingAPI.Metadata
|
|||
yield return new MethodToAnotherStaticMethodRewriter(typeof(ISoundBank), (method) => method.Name == nameof(SoundBankMethods.GetCueDefinition), typeof(SoundBankMethods), "GetCueDefinition");
|
||||
|
||||
yield return new MethodToAnotherStaticMethodRewriter(typeof(Enum), (method) => method.Name == nameof(EnumMethods.IsDefined) && method.Parameters.Count == 1, typeof(EnumMethods), "IsDefined");
|
||||
yield return new MethodToAnotherStaticMethodRewriter(typeof(Enum), (method) => method.Name == nameof(EnumMethods.GetNames) && method.Parameters.Count == 0, typeof(EnumMethods), "GetNames");
|
||||
|
||||
//Constructor Rewrites
|
||||
yield return new MethodParentRewriter(typeof(MapPage), typeof(MapPageMethods));
|
||||
|
|
Loading…
Reference in New Issue