From 2349a92de6e3d1db1163242929bad15d41498030 Mon Sep 17 00:00:00 2001 From: adelikat Date: Sun, 1 Mar 2020 15:56:38 -0600 Subject: [PATCH] remove StickyOrAdapter, and ISticky interface, they became vestigial at some point --- BizHawk.Client.Common/BinarySaveStates.cs | 1 + .../inputAdapters/StickyAdapters.cs | 63 +------------------ 2 files changed, 3 insertions(+), 61 deletions(-) diff --git a/BizHawk.Client.Common/BinarySaveStates.cs b/BizHawk.Client.Common/BinarySaveStates.cs index b8a19175ec..bf596b1e66 100644 --- a/BizHawk.Client.Common/BinarySaveStates.cs +++ b/BizHawk.Client.Common/BinarySaveStates.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Reflection; using ICSharpCode.SharpZipLib.Zip; +// ReSharper disable UnusedAutoPropertyAccessor.Local namespace BizHawk.Client.Common { public class BinaryStateLump diff --git a/BizHawk.Client.Common/inputAdapters/StickyAdapters.cs b/BizHawk.Client.Common/inputAdapters/StickyAdapters.cs index bf663c38df..578bdb14ec 100644 --- a/BizHawk.Client.Common/inputAdapters/StickyAdapters.cs +++ b/BizHawk.Client.Common/inputAdapters/StickyAdapters.cs @@ -6,53 +6,8 @@ using BizHawk.Emulation.Common; namespace BizHawk.Client.Common { - public interface ISticky : IController + public class StickyXorAdapter : IController { - bool StickyIsInEffect(string button); - } - - /// - /// Used by input display, to determine if either autofire or regular stickies - /// are "in effect" because we color this scenario differently - /// - public class StickyOrAdapter : IController - { - public ControllerDefinition Definition => Source.Definition; - - public bool IsPressed(string button) - { - return Source.StickyIsInEffect(button) - || SourceStickyOr.StickyIsInEffect(button); - } - - // pass floats solely from the original source - // this works in the code because SourceOr is the autofire controller - public float GetFloat(string name) - { - int i = Source.Definition.FloatControls.IndexOf(name); - return Source.Definition.FloatRanges[i].Mid; // Floats don't make sense in sticky land - } - - public ISticky Source { get; set; } - public ISticky SourceStickyOr { get; set; } - } - - public class StickyXorAdapter : ISticky, IController - { - /// - /// Determines if a sticky is current mashing the button itself, - /// If sticky is not set then false, if set, it returns true if the Source is not pressed, else false - /// - public bool StickyIsInEffect(string button) - { - if (IsSticky(button)) - { - return !Source.IsPressed(button); - } - - return false; - } - public ControllerDefinition Definition => Source.Definition; public bool IsPressed(string button) @@ -155,22 +110,8 @@ namespace BizHawk.Client.Common } } - public class AutoFireStickyXorAdapter : ISticky, IController + public class AutoFireStickyXorAdapter : IController { - /// - /// Determines if a sticky is current mashing the button itself, - /// If sticky is not set then false, if set, it returns true if the Source is not pressed, else false - /// - public bool StickyIsInEffect(string button) - { - if (IsSticky(button)) - { - return !Source.IsPressed(button); - } - - return false; - } - public ControllerDefinition Definition => Source.Definition; public bool IsPressed(string button)