diff --git a/BizHawk.Client.Common/movie/tasproj/IStateManager.cs b/BizHawk.Client.Common/movie/tasproj/IStateManager.cs index 2524c33c32..eb723f06a4 100644 --- a/BizHawk.Client.Common/movie/tasproj/IStateManager.cs +++ b/BizHawk.Client.Common/movie/tasproj/IStateManager.cs @@ -34,6 +34,8 @@ namespace BizHawk.Client.Common bool Any(); + int Count { get; } + // TODO: rename to Last int LastStatedFrame { get; } @@ -52,8 +54,6 @@ namespace BizHawk.Client.Common bool RemoveState(int frame); - int StateCount { get; } - int GetStateIndexByFrame(int frame); int GetStateFrameByIndex(int index); diff --git a/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs b/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs index 8769b1277b..e7b638d662 100644 --- a/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs +++ b/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs @@ -65,7 +65,7 @@ namespace BizHawk.Client.Common // todo: go through all states once, remove as many as we need. refactor to not need goto public void Trigger(int decayStates) { - for (; decayStates > 0 && _tsm.StateCount > 1;) + for (; decayStates > 0 && _tsm.Count > 1;) { int baseStateIndex = _tsm.GetStateIndexByFrame(Global.Emulator.Frame); int baseStateFrame = _tsm.GetStateFrameByIndex(baseStateIndex) / _step; // reduce right away @@ -119,7 +119,7 @@ namespace BizHawk.Client.Common } } - for (int currentStateIndex = _tsm.StateCount - 1; currentStateIndex > baseStateIndex; currentStateIndex--) + for (int currentStateIndex = _tsm.Count - 1; currentStateIndex > baseStateIndex; currentStateIndex--) { int currentFrame = _tsm.GetStateFrameByIndex(currentStateIndex); diff --git a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs index 6de8df4211..59c1065ef2 100644 --- a/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs +++ b/BizHawk.Client.Common/movie/tasproj/TasStateManager.cs @@ -22,6 +22,7 @@ namespace BizHawk.Client.Common public Action InvalidateCallback { get; set; } + private void CallInvalidateCallback(int index) { InvalidateCallback?.Invoke(index); @@ -135,7 +136,7 @@ namespace BizHawk.Client.Common } } - public byte[] InitialState + private byte[] InitialState { get { @@ -281,9 +282,9 @@ namespace BizHawk.Client.Common /// public void LimitStateCount() { - if (StateCount + 1 > _maxStates || DiskUsed > (ulong)Settings.DiskCapacitymb * 1024 * 1024) + if (Count + 1 > _maxStates || DiskUsed > (ulong)Settings.DiskCapacitymb * 1024 * 1024) { - _decay.Trigger(StateCount + 1 - _maxStates); + _decay.Trigger(Count + 1 - _maxStates); } } @@ -498,7 +499,7 @@ namespace BizHawk.Client.Common } } - public int StateCount => _states.Count; + public int Count => _states.Count; public bool Any() { @@ -527,7 +528,7 @@ namespace BizHawk.Client.Common { get { - if (StateCount > 0) + if (Count > 0) { return LastKey; } diff --git a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index c9a866b822..6f9a438201 100644 --- a/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -995,7 +995,7 @@ namespace BizHawk.Client.EmuHawk private void SetSplicer() { // TODO: columns selected? - var temp = $"Selected: {TasView.SelectedRows.Count()} {(TasView.SelectedRows.Count() == 1 ? "frame" : "frames")}, States: {CurrentTasMovie.TasStateManager.StateCount}"; + var temp = $"Selected: {TasView.SelectedRows.Count()} {(TasView.SelectedRows.Count() == 1 ? "frame" : "frames")}, States: {CurrentTasMovie.TasStateManager.Count}"; if (_tasClipboard.Any()) temp += $", Clipboard: {_tasClipboard.Count} {(_tasClipboard.Count == 1 ? "frame" : "frames")}"; SplicerStatusLabel.Text = temp; }