diff --git a/BizHawk.Client.Common/BitmapBufferVideoProvider.cs b/BizHawk.Client.Common/BitmapBufferVideoProvider.cs index 1c039b23e4..2fa5282eb2 100644 --- a/BizHawk.Client.Common/BitmapBufferVideoProvider.cs +++ b/BizHawk.Client.Common/BitmapBufferVideoProvider.cs @@ -20,10 +20,7 @@ namespace BizHawk.Client.Common _bb = null; } - public int[] GetVideoBuffer() - { - return _bb.Pixels; - } + public int[] GetVideoBuffer() => _bb.Pixels; public int VirtualWidth => _bb.Width; diff --git a/BizHawk.Client.Common/inputAdapters/ClickyVirtualPadController.cs b/BizHawk.Client.Common/inputAdapters/ClickyVirtualPadController.cs index dca60b34da..7c0bcd0c3b 100644 --- a/BizHawk.Client.Common/inputAdapters/ClickyVirtualPadController.cs +++ b/BizHawk.Client.Common/inputAdapters/ClickyVirtualPadController.cs @@ -10,38 +10,23 @@ namespace BizHawk.Client.Common /// public class ClickyVirtualPadController : IController { + private readonly HashSet _pressed = new HashSet(); + public ControllerDefinition Definition { get; set; } - public bool IsPressed(string button) - { - return _pressed.Contains(button); - } + public bool IsPressed(string button) => _pressed.Contains(button); - public float AxisValue(string name) - { - return 0.0f; - } + public float AxisValue(string name) => 0.0f; /// /// Call this once per frame to do the timekeeping for the hold and release /// - public void FrameTick() - { - _pressed.Clear(); - } + public void FrameTick() => _pressed.Clear(); /// /// Call this to hold the button down for one frame /// - public void Click(string button) - { - _pressed.Add(button); - } - - public void Unclick(string button) - { - _pressed.Remove(button); - } + public void Click(string button) => _pressed.Add(button); public void Toggle(string button) { @@ -66,7 +51,5 @@ namespace BizHawk.Client.Common _pressed.Add(button); } } - - private readonly HashSet _pressed = new HashSet(); } } diff --git a/BizHawk.Client.Common/inputAdapters/CopyController.cs b/BizHawk.Client.Common/inputAdapters/CopyController.cs index b0f4b9e43d..0885f692f5 100644 --- a/BizHawk.Client.Common/inputAdapters/CopyController.cs +++ b/BizHawk.Client.Common/inputAdapters/CopyController.cs @@ -9,15 +9,9 @@ namespace BizHawk.Client.Common { public ControllerDefinition Definition => Curr.Definition; - public bool IsPressed(string button) - { - return Curr.IsPressed(button); - } + public bool IsPressed(string button) => Curr.IsPressed(button); - public float AxisValue(string name) - { - return Curr.AxisValue(name); - } + public float AxisValue(string name) => Curr.AxisValue(name); public IController Source { get; set; } diff --git a/BizHawk.Client.Common/inputAdapters/OverrideAdapter.cs b/BizHawk.Client.Common/inputAdapters/OverrideAdapter.cs index ee7b0ee0c1..1b66b91b74 100644 --- a/BizHawk.Client.Common/inputAdapters/OverrideAdapter.cs +++ b/BizHawk.Client.Common/inputAdapters/OverrideAdapter.cs @@ -32,7 +32,6 @@ namespace BizHawk.Client.Common => _axisOverrides.ContainsKey(name) ? _axisOverrides[name] : 0.0F; - public IEnumerable Overrides => _overrides.Select(kvp => kvp.Key); diff --git a/BizHawk.Client.Common/inputAdapters/SimpleController.cs b/BizHawk.Client.Common/inputAdapters/SimpleController.cs index cc8965419d..d1c8b65535 100644 --- a/BizHawk.Client.Common/inputAdapters/SimpleController.cs +++ b/BizHawk.Client.Common/inputAdapters/SimpleController.cs @@ -27,15 +27,9 @@ namespace BizHawk.Client.Common set => Buttons[button] = value; } - public virtual bool IsPressed(string button) - { - return this[button]; - } + public virtual bool IsPressed(string button) => this[button]; - public float AxisValue(string name) - { - return Axes[name]; - } + public float AxisValue(string name) => Axes[name]; public IEnumerable> BoolButtons() { diff --git a/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs b/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs index 74243aff8a..beb36b9ec7 100644 --- a/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs +++ b/BizHawk.Client.EmuHawk/tools/Lua/LuaRegisteredFunctionsList.cs @@ -107,7 +107,7 @@ namespace BizHawk.Client.EmuHawk private void RemoveAllBtn_Click(object sender, EventArgs e) { - _registeredFunctions.Clear(); + _registeredFunctions.Clear(Global.Emulator); // TODO: don't use Global PopulateListView(); }