rename IStateManager.ClearStateHistory -> Clear, LastStatedFrame -> Last

This commit is contained in:
adelikat 2019-06-15 15:19:18 -05:00
parent 0ab1b1887e
commit 6004f30d3a
5 changed files with 10 additions and 12 deletions

View File

@ -168,7 +168,7 @@ namespace BizHawk.Client.Common.MovieConversionExtensions
// States can't be easily moved over, because they contain the frame number.
// TODO? I'm not sure how this would be done.
tas.TasStateManager.MountWriteAccess();
old.TasStateManager.ClearStateHistory();
old.TasStateManager.Clear();
// Lag Log
tas.TasLagLog.FromLagLog(old.TasLagLog);
@ -242,7 +242,7 @@ namespace BizHawk.Client.Common.MovieConversionExtensions
}
var tas = new TasMovie(newFilename, true) { SaveRam = saveRam };
tas.TasStateManager.ClearStateHistory();
tas.TasStateManager.Clear();
tas.ClearLagLog();
var entries = old.GetLogEntries();

View File

@ -7,7 +7,7 @@ namespace BizHawk.Client.Common
using BizHawk.Common;
public interface IStateManager : IDisposable
public interface IStateManager
{
// byte[] this[int frame] { get; } // TODO: I had it refactored to this back in the day
KeyValuePair<int, byte[]> this[int frame] { get; }
@ -22,9 +22,8 @@ namespace BizHawk.Client.Common
bool Invalidate(int frame);
// TODO: rename to Clear()
// TODO: consider it passing a bool if anything was cleared, and the .Any() could go away
void ClearStateHistory();
void Clear();
void Save(BinaryWriter bw);
@ -36,8 +35,7 @@ namespace BizHawk.Client.Common
int Count { get; }
// TODO: rename to Last
int LastStatedFrame { get; }
int Last { get; }
bool IsMarkerState(int frame);

View File

@ -272,7 +272,7 @@ namespace BizHawk.Client.Common
private void ClearTasprojExtras()
{
ClearLagLog();
_stateManager.ClearStateHistory();
_stateManager.Clear();
Markers.Clear();
ChangeLog.ClearLog();
}

View File

@ -35,7 +35,7 @@ namespace BizHawk.Client.Common
public TasLagLog TasLagLog => _lagLog;
public IStringLog InputLog => Log;
public int BranchCount => Branches.Count;
public int LastStatedFrame => _stateManager.LastStatedFrame;
public int LastStatedFrame => _stateManager.Last;
public override string PreferredExtension => Extension;
public IStateManager TasStateManager => _stateManager;
@ -218,7 +218,7 @@ namespace BizHawk.Client.Common
{
if (_stateManager.Any())
{
_stateManager.ClearStateHistory();
_stateManager.Clear();
Changes = true;
}
}

View File

@ -317,7 +317,7 @@ namespace BizHawk.Client.Common
return ret;
}
public void ClearStateHistory()
public void Clear()
{
if (_states.Any())
{
@ -450,7 +450,7 @@ namespace BizHawk.Client.Common
}
}
public int LastStatedFrame
public int Last
{
get
{