diff --git a/src/Ryujinx.Input/ButtonValue.cs b/src/Ryujinx.Input/ButtonValue.cs index 4a1f8724b..f037e6b60 100644 --- a/src/Ryujinx.Input/ButtonValue.cs +++ b/src/Ryujinx.Input/ButtonValue.cs @@ -4,45 +4,45 @@ namespace Ryujinx.Input { public enum ButtonValueType { Key, GamepadButtonInputId, StickId } - public struct ButtonValue + public readonly struct ButtonValue { - private ButtonValueType Type; - private uint RawValue; + private readonly ButtonValueType _type; + private readonly uint _rawValue; public ButtonValue(Key key) { - Type = ButtonValueType.Key; - RawValue = (uint)key; + _type = ButtonValueType.Key; + _rawValue = (uint)key; } public ButtonValue(GamepadButtonInputId gamepad) { - Type = ButtonValueType.GamepadButtonInputId; - RawValue = (uint)gamepad; + _type = ButtonValueType.GamepadButtonInputId; + _rawValue = (uint)gamepad; } public ButtonValue(StickInputId stick) { - Type = ButtonValueType.StickId; - RawValue = (uint)stick; + _type = ButtonValueType.StickId; + _rawValue = (uint)stick; } public Common.Configuration.Hid.Key AsKey() { - Debug.Assert(Type == ButtonValueType.Key); - return (Common.Configuration.Hid.Key)RawValue; + Debug.Assert(_type == ButtonValueType.Key); + return (Common.Configuration.Hid.Key)_rawValue; } public Common.Configuration.Hid.Controller.GamepadInputId AsGamepadButtonInputId() { - Debug.Assert(Type == ButtonValueType.GamepadButtonInputId); - return (Common.Configuration.Hid.Controller.GamepadInputId)RawValue; + Debug.Assert(_type == ButtonValueType.GamepadButtonInputId); + return (Common.Configuration.Hid.Controller.GamepadInputId)_rawValue; } public Common.Configuration.Hid.Controller.StickInputId AsGamepadStickId() { - Debug.Assert(Type == ButtonValueType.StickId); - return (Common.Configuration.Hid.Controller.StickInputId)RawValue; + Debug.Assert(_type == ButtonValueType.StickId); + return (Common.Configuration.Hid.Controller.StickInputId)_rawValue; } } }