remove StickyOrAdapter, and ISticky interface, they became vestigial at some point

This commit is contained in:
adelikat 2020-03-01 15:56:38 -06:00
parent 18762c75ee
commit 2349a92de6
2 changed files with 3 additions and 61 deletions

View File

@ -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

View File

@ -6,53 +6,8 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Client.Common
{
public interface ISticky : IController
public class StickyXorAdapter : IController
{
bool StickyIsInEffect(string button);
}
/// <summary>
/// Used by input display, to determine if either autofire or regular stickies
/// are "in effect" because we color this scenario differently
/// </summary>
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
{
/// <summary>
/// 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
/// </summary>
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
{
/// <summary>
/// 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
/// </summary>
public bool StickyIsInEffect(string button)
{
if (IsSticky(button))
{
return !Source.IsPressed(button);
}
return false;
}
public ControllerDefinition Definition => Source.Definition;
public bool IsPressed(string button)