mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-06-28 23:50:46 -07:00
Use Enum and Delegate.CreateDelegate generic overloads (#3111)
* Use Enum generic overloads * Remove EnumExtensions.cs * Use Delegate.CreateDelegate generic overloads
This commit is contained in:
@ -102,7 +102,7 @@ namespace Ryujinx.HLE.FileSystem.Content
|
||||
_contentDictionary = new SortedDictionary<(ulong, NcaContentType), string>();
|
||||
_locationEntries = new Dictionary<StorageId, LinkedList<LocationEntry>>();
|
||||
|
||||
foreach (StorageId storageId in Enum.GetValues(typeof(StorageId)))
|
||||
foreach (StorageId storageId in Enum.GetValues<StorageId>())
|
||||
{
|
||||
string contentDirectory = null;
|
||||
string contentPathString = null;
|
||||
|
@ -433,7 +433,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
|
||||
|
||||
generator.Emit(OpCodes.Ret);
|
||||
|
||||
return (Action<T, ExecutionContext>)method.CreateDelegate(typeof(Action<T, ExecutionContext>));
|
||||
return method.CreateDelegate<Action<T, ExecutionContext>>();
|
||||
}
|
||||
|
||||
private static void CheckIfTypeIsSupported(Type type, string svcName)
|
||||
|
@ -1021,7 +1021,7 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
||||
|
||||
HidVibrationDeviceType vibrationDeviceType = HidVibrationDeviceType.None;
|
||||
|
||||
if (Enum.IsDefined(typeof(NpadStyleIndex), deviceType))
|
||||
if (Enum.IsDefined<NpadStyleIndex>(deviceType))
|
||||
{
|
||||
vibrationDeviceType = HidVibrationDeviceType.LinearResonantActuator;
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ namespace Ryujinx.HLE.HOS.SystemState
|
||||
SystemLanguage.TraditionalChinese => TitleLanguage.Taiwanese,
|
||||
SystemLanguage.Chinese or
|
||||
SystemLanguage.SimplifiedChinese => TitleLanguage.Chinese,
|
||||
_ => Enum.Parse<TitleLanguage>(Enum.GetName(typeof(SystemLanguage), language)),
|
||||
_ => Enum.Parse<TitleLanguage>(Enum.GetName<SystemLanguage>(language)),
|
||||
};
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user