From 0164db5532d3c0bb3835e634bc2f993185ab8ef3 Mon Sep 17 00:00:00 2001 From: adelikat Date: Fri, 10 Jan 2014 22:56:59 +0000 Subject: [PATCH] Remove a no longer needed file --- .../BizHawk.Client.Common.csproj | 1 - .../movie/NewMnemonicsGenerator.cs | 162 ------------------ 2 files changed, 163 deletions(-) delete mode 100644 BizHawk.Client.Common/movie/NewMnemonicsGenerator.cs diff --git a/BizHawk.Client.Common/BizHawk.Client.Common.csproj b/BizHawk.Client.Common/BizHawk.Client.Common.csproj index 4584c20b52..ff6bde7b47 100644 --- a/BizHawk.Client.Common/BizHawk.Client.Common.csproj +++ b/BizHawk.Client.Common/BizHawk.Client.Common.csproj @@ -141,7 +141,6 @@ - diff --git a/BizHawk.Client.Common/movie/NewMnemonicsGenerator.cs b/BizHawk.Client.Common/movie/NewMnemonicsGenerator.cs deleted file mode 100644 index adc39df850..0000000000 --- a/BizHawk.Client.Common/movie/NewMnemonicsGenerator.cs +++ /dev/null @@ -1,162 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -using BizHawk.Emulation.Common; - -namespace BizHawk.Client.Common -{ - // Used with the version 2 movie implementation (TasMovie.cs) - /* - public class NewMnemonicsGenerator - { - public MnemonicLookupTable MnemonicLookup { get; private set; } - public IController Source { get; set; } - - public List ActivePlayers { get; set; } - - public NewMnemonicsGenerator(IController source) - { - MnemonicLookup = new MnemonicLookupTable(); - Source = source; - ActivePlayers = MnemonicLookup[Global.Emulator.SystemId].Select(x => x.Name).ToList(); - } - - public bool IsEmpty - { - get - { - return ActiveCollections - .SelectMany(mc => mc) - .All(kvp => !this.Source.IsPressed(kvp.Key)); - } - } - - public string EmptyMnemonic - { - get - { - var sb = new StringBuilder(); - - sb.Append('|'); - foreach (var mc in ActiveCollections) - { - foreach (var kvp in mc) - { - sb.Append('.'); - } - - sb.Append('|'); - } - - return sb.ToString(); - } - } - - public Dictionary ParseMnemonicString(string mnemonic) - { - // TODo: clean me up - var buttons = new Dictionary(); - var collections = AllCollections.SelectMany(mc => mc).ToList(); - var availMnemonics = AvailableMnemonics; - List mnemonicList = mnemonic.Replace("|", "").ToCharArray().ToList(); - - for (int i = 0; i < collections.Count; i++) - { - if (availMnemonics.ContainsKey(collections[i].Key)) - { - buttons.Add(collections[i].Key, mnemonicList[i] != '.'); - } - } - - return buttons; - } - - public string GenerateMnemonicString(Dictionary buttons) - { - var collections = MnemonicLookup[Global.Emulator.SystemId].Where(x => ActivePlayers.Contains(x.Name)); - var sb = new StringBuilder(); - - sb.Append('|'); - foreach (var mc in collections) - { - foreach (var kvp in mc.Where(kvp => buttons.ContainsKey(kvp.Key))) - { - sb.Append(buttons[kvp.Key] ? kvp.Value : '.'); - } - - sb.Append('|'); - } - return sb.ToString(); - } - - public string MnemonicString - { - get - { - var sb = new StringBuilder(); - sb.Append('|'); - foreach (var mc in ActiveCollections) - { - foreach (var kvp in mc) - { - sb.Append(Source.IsPressed(kvp.Key) ? kvp.Value : '.'); - } - - sb.Append('|'); - } - - return sb.ToString(); - } - } - - public IEnumerable Mnemonics - { - get - { - var mnemonics = new List(); - foreach (var mc in ActiveCollections) - { - mnemonics.AddRange(mc.Select(x => x.Value)); - } - - return mnemonics; - } - } - - public Dictionary AvailableMnemonics - { - get - { - return ActiveCollections - .SelectMany(mc => mc) - .ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - } - } - - public Dictionary GetBoolButtons() - { - return ActiveCollections - .SelectMany(mc => mc) - .ToDictionary(kvp => kvp.Key, kvp => this.Source.IsPressed(kvp.Key)); - } - - private IEnumerable ActiveCollections - { - get - { - return MnemonicLookup[Global.Emulator.SystemId].Where(x => ActivePlayers.Contains(x.Name)); - } - } - - private IEnumerable AllCollections - { - get - { - return MnemonicLookup[Global.Emulator.SystemId]; - } - } - } - */ -}