From 2a8b4504cd5934d4b51827ffa8b5c3c11c3ff74d Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 15 Jun 2019 15:43:22 -0500 Subject: [PATCH] Simplify --- .../movie/tasproj/IStateManager.cs | 14 ++++++-------- .../movie/tasproj/TasStateManager.cs | 9 ++++----- .../tools/TAStudio/TAStudio.MenuItems.cs | 1 - 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/BizHawk.Client.Common/movie/tasproj/IStateManager.cs b/BizHawk.Client.Common/movie/tasproj/IStateManager.cs index 327e108288..e45cd078ce 100644 --- a/BizHawk.Client.Common/movie/tasproj/IStateManager.cs +++ b/BizHawk.Client.Common/movie/tasproj/IStateManager.cs @@ -38,18 +38,16 @@ namespace BizHawk.Client.Common bool IsMarkerState(int frame); + int GetStateIndexByFrame(int frame); + + int GetStateFrameByIndex(int index); + + void UpdateStateFrequency(); + // ********* Delete these ********** void MountWriteAccess(); // *********** Reconsider these ************/ - void LimitStateCount(); - - void UpdateStateFrequency(); - bool RemoveState(int frame); - - int GetStateIndexByFrame(int frame); - - int GetStateFrameByIndex(int index); } } diff --git a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs index cc13f44c28..e35f67d839 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs @@ -58,6 +58,7 @@ namespace BizHawk.Client.Common .Clamp(_minFrequency, _maxFrequency); _decay.UpdateSettings(MaxStates, _stateFrequency, 4); + LimitStateCount(); } /// @@ -246,11 +247,9 @@ namespace BizHawk.Client.Common return true; } - /// - /// Deletes states to follow the state storage size limits. - /// Used after changing the settings too. - /// - public void LimitStateCount() + // Deletes states to follow the state storage size limits. + // Used after changing the settings too. + private void LimitStateCount() { if (Count + 1 > MaxStates) { diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 3695e8d996..d7743fc18f 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -1080,7 +1080,6 @@ namespace BizHawk.Client.EmuHawk Statable = this.StatableEmulator }.ShowDialog(); CurrentTasMovie.TasStateManager.UpdateStateFrequency(); - CurrentTasMovie.TasStateManager.LimitStateCount(); UpdateChangesIndicator(); }