diff options
| author | TSRBerry <20988865+TSRBerry@users.noreply.github.com> | 2023-06-28 18:41:38 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-06-28 18:41:38 +0200 |
| commit | fc20d9b925b83532a19467293a7cdcbaa4ef3d6b (patch) | |
| tree | ebe0e690b6644d0f825ee80f20e4067855f35cf4 /src/Ryujinx.Common/Configuration/Hid/Controller | |
| parent | 0a75b73fa43ddadf561ddeb0f923c6f3811c025b (diff) | |
[Ryujinx.Common] Address dotnet-format issues (#5358)
* dotnet format style --severity info
Some changes were manually reverted.
* dotnet format analyzers --serverity info
Some changes have been minimally adapted.
* Restore a few unused methods and variables
* Silence dotnet format IDE0060 warnings
* Silence dotnet format IDE0059 warnings
* Address or silence dotnet format IDE1006 warnings
* Address dotnet format CA1816 warnings
* Address or silence dotnet format CA2211 warnings
* Silence CA1806 and CA1834 issues
* Fix formatting for switch expressions
* Address most dotnet format whitespace warnings
* Apply dotnet format whitespace formatting
A few of them have been manually reverted and the corresponding warning was silenced
* Revert formatting changes for while and for-loops
* Format if-blocks correctly
* Run dotnet format whitespace after rebase
* Run dotnet format style after rebase
* Run dotnet format analyzers after rebase
* Run dotnet format after rebase and remove unused usings
- analyzers
- style
- whitespace
* Add comments to disabled warnings
* Remove a few unused parameters
* Replace MmeShadowScratch with Array256<uint>
* Simplify properties and array initialization, Use const when possible, Remove trailing commas
* Run dotnet format after rebase
* Address IDE0251 warnings
* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"
This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.
* dotnet format whitespace after rebase
* First dotnet format pass
* Second dotnet format pass
* Fix build issues
* Fix StructArrayHelpers.cs
* Apply suggestions from code review
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Fix return statements
* Fix naming rule violations
* Update src/Ryujinx.Common/Utilities/StreamUtils.cs
Co-authored-by: Ac_K <Acoustik666@gmail.com>
* Add trailing commas
* Address review feedback
* Address review feedback
* Rename remaining type parameters to TKey and TValue
* Fix manual formatting for logging levels
* Fix spacing before comments
---------
Co-authored-by: Ac_K <Acoustik666@gmail.com>
Diffstat (limited to 'src/Ryujinx.Common/Configuration/Hid/Controller')
6 files changed, 16 insertions, 16 deletions
diff --git a/src/Ryujinx.Common/Configuration/Hid/Controller/GamepadInputId.cs b/src/Ryujinx.Common/Configuration/Hid/Controller/GamepadInputId.cs index ad1fa667..78bc46f2 100644 --- a/src/Ryujinx.Common/Configuration/Hid/Controller/GamepadInputId.cs +++ b/src/Ryujinx.Common/Configuration/Hid/Controller/GamepadInputId.cs @@ -53,6 +53,6 @@ namespace Ryujinx.Common.Configuration.Hid.Controller SingleLeftTrigger1, SingleRightTrigger1, - Count + Count, } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.Common/Configuration/Hid/Controller/GenericControllerInputConfig.cs b/src/Ryujinx.Common/Configuration/Hid/Controller/GenericControllerInputConfig.cs index d7f0e788..abc245bc 100644 --- a/src/Ryujinx.Common/Configuration/Hid/Controller/GenericControllerInputConfig.cs +++ b/src/Ryujinx.Common/Configuration/Hid/Controller/GenericControllerInputConfig.cs @@ -4,7 +4,7 @@ using System.Text.Json.Serialization; namespace Ryujinx.Common.Configuration.Hid.Controller { - public class GenericControllerInputConfig<Button, Stick> : GenericInputConfigurationCommon<Button> where Button : unmanaged where Stick : unmanaged + public class GenericControllerInputConfig<TButton, TStick> : GenericInputConfigurationCommon<TButton> where TButton : unmanaged where TStick : unmanaged { [JsonIgnore] private float _deadzoneLeft; @@ -16,12 +16,12 @@ namespace Ryujinx.Common.Configuration.Hid.Controller /// <summary> /// Left JoyCon Controller Stick Bindings /// </summary> - public JoyconConfigControllerStick<Button, Stick> LeftJoyconStick { get; set; } + public JoyconConfigControllerStick<TButton, TStick> LeftJoyconStick { get; set; } /// <summary> /// Right JoyCon Controller Stick Bindings /// </summary> - public JoyconConfigControllerStick<Button, Stick> RightJoyconStick { get; set; } + public JoyconConfigControllerStick<TButton, TStick> RightJoyconStick { get; set; } /// <summary> /// Controller Left Analog Stick Deadzone diff --git a/src/Ryujinx.Common/Configuration/Hid/Controller/JoyconConfigControllerStick.cs b/src/Ryujinx.Common/Configuration/Hid/Controller/JoyconConfigControllerStick.cs index 869cff4f..aaa3ef1d 100644 --- a/src/Ryujinx.Common/Configuration/Hid/Controller/JoyconConfigControllerStick.cs +++ b/src/Ryujinx.Common/Configuration/Hid/Controller/JoyconConfigControllerStick.cs @@ -1,11 +1,11 @@ namespace Ryujinx.Common.Configuration.Hid.Controller { - public class JoyconConfigControllerStick<Button, Stick> where Button: unmanaged where Stick: unmanaged + public class JoyconConfigControllerStick<TButton, TStick> where TButton : unmanaged where TStick : unmanaged { - public Stick Joystick { get; set; } + public TStick Joystick { get; set; } public bool InvertStickX { get; set; } public bool InvertStickY { get; set; } public bool Rotate90CW { get; set; } - public Button StickButton { get; set; } + public TButton StickButton { get; set; } } } diff --git a/src/Ryujinx.Common/Configuration/Hid/Controller/Motion/JsonMotionConfigControllerConverter.cs b/src/Ryujinx.Common/Configuration/Hid/Controller/Motion/JsonMotionConfigControllerConverter.cs index 2b9e0af4..61353371 100644 --- a/src/Ryujinx.Common/Configuration/Hid/Controller/Motion/JsonMotionConfigControllerConverter.cs +++ b/src/Ryujinx.Common/Configuration/Hid/Controller/Motion/JsonMotionConfigControllerConverter.cs @@ -7,7 +7,7 @@ namespace Ryujinx.Common.Configuration.Hid.Controller.Motion { class JsonMotionConfigControllerConverter : JsonConverter<MotionConfigController> { - private static readonly MotionConfigJsonSerializerContext SerializerContext = new(JsonHelper.GetDefaultSerializerOptions()); + private static readonly MotionConfigJsonSerializerContext _serializerContext = new(JsonHelper.GetDefaultSerializerOptions()); private static MotionInputBackendType GetMotionInputBackendType(ref Utf8JsonReader reader) { @@ -55,8 +55,8 @@ namespace Ryujinx.Common.Configuration.Hid.Controller.Motion return motionBackendType switch { - MotionInputBackendType.GamepadDriver => JsonSerializer.Deserialize(ref reader, SerializerContext.StandardMotionConfigController), - MotionInputBackendType.CemuHook => JsonSerializer.Deserialize(ref reader, SerializerContext.CemuHookMotionConfigController), + MotionInputBackendType.GamepadDriver => JsonSerializer.Deserialize(ref reader, _serializerContext.StandardMotionConfigController), + MotionInputBackendType.CemuHook => JsonSerializer.Deserialize(ref reader, _serializerContext.CemuHookMotionConfigController), _ => throw new InvalidOperationException($"Unknown backend type {motionBackendType}"), }; } @@ -66,10 +66,10 @@ namespace Ryujinx.Common.Configuration.Hid.Controller.Motion switch (value.MotionBackend) { case MotionInputBackendType.GamepadDriver: - JsonSerializer.Serialize(writer, value as StandardMotionConfigController, SerializerContext.StandardMotionConfigController); + JsonSerializer.Serialize(writer, value as StandardMotionConfigController, _serializerContext.StandardMotionConfigController); break; case MotionInputBackendType.CemuHook: - JsonSerializer.Serialize(writer, value as CemuHookMotionConfigController, SerializerContext.CemuHookMotionConfigController); + JsonSerializer.Serialize(writer, value as CemuHookMotionConfigController, _serializerContext.CemuHookMotionConfigController); break; default: throw new ArgumentException($"Unknown motion backend type {value.MotionBackend}"); diff --git a/src/Ryujinx.Common/Configuration/Hid/Controller/Motion/MotionConfigJsonSerializerContext.cs b/src/Ryujinx.Common/Configuration/Hid/Controller/Motion/MotionConfigJsonSerializerContext.cs index 5cd9e452..f9d154ff 100644 --- a/src/Ryujinx.Common/Configuration/Hid/Controller/Motion/MotionConfigJsonSerializerContext.cs +++ b/src/Ryujinx.Common/Configuration/Hid/Controller/Motion/MotionConfigJsonSerializerContext.cs @@ -9,4 +9,4 @@ namespace Ryujinx.Common.Configuration.Hid.Controller.Motion public partial class MotionConfigJsonSerializerContext : JsonSerializerContext { } -}
\ No newline at end of file +} diff --git a/src/Ryujinx.Common/Configuration/Hid/Controller/StickInputId.cs b/src/Ryujinx.Common/Configuration/Hid/Controller/StickInputId.cs index 5fc4d1c8..cbe63e57 100644 --- a/src/Ryujinx.Common/Configuration/Hid/Controller/StickInputId.cs +++ b/src/Ryujinx.Common/Configuration/Hid/Controller/StickInputId.cs @@ -10,6 +10,6 @@ namespace Ryujinx.Common.Configuration.Hid.Controller Left, Right, - Count + Count, } -}
\ No newline at end of file +} |
