diff --git a/src/BizHawk.Client.Common/movie/tasproj/IStateManager.cs b/src/BizHawk.Client.Common/movie/tasproj/IStateManager.cs index e3c0146715..e29c8d40ff 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/IStateManager.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/IStateManager.cs @@ -42,32 +42,45 @@ namespace BizHawk.Client.Common /// bool Invalidate(int frame); + // Remove all states, but not the frame 0 state void Clear(); void Save(BinaryWriter bw); void Load(BinaryReader br); + /// + /// Get a nearby state. The returned frame must be less (but not equal to???) the passed frame. + /// This may not fail; the StateManager strongly holds a frame 0 state to ensure there's always a possible result. + /// + /// + /// KeyValuePair GetStateClosestToFrame(int frame); + /// + /// Returns true iff Count > 0 + /// TODO: Surely this is always true because the frame 0 state is always retained? + /// + /// bool Any(); + /// + /// Returns the total number of states currently held by the state manager + /// + /// int Count { get; } + /// + /// Returns the most recent frame number that the state manager possesses + /// + /// int Last { get; } + /// + /// Adjust internal state saving logic based on changes to Settings + /// void UpdateStateFrequency(); - /// - /// Returns index of the state right above the given frame - /// - int GetStateIndexByFrame(int frame); - - /// - /// Returns frame of the state at the given index - /// - int GetStateFrameByIndex(int index); - /// /// Directly remove a state from the given frame, if it exists /// Should only be called by pruning operations diff --git a/src/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs b/src/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs index ed54fbdbb9..addd1adb4e 100644 --- a/src/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs +++ b/src/BizHawk.Client.Common/movie/tasproj/StateManagerDecay.cs @@ -46,7 +46,7 @@ namespace BizHawk.Client.Common internal class StateManagerDecay { private readonly ITasMovie _movie; - private readonly IStateManager _tsm; + private readonly TasStateManager _tsm; private List _zeros; // amount of least significant zeros in bitwise view (also max pattern step) private int _bits; // size of _zeros is 2 raised to the power of _bits @@ -56,7 +56,7 @@ namespace BizHawk.Client.Common private int _step; // initial memory state gap private bool _align; // extra care about fine alignment. TODO: do we want it? - public StateManagerDecay(ITasMovie movie, IStateManager tsm) + public StateManagerDecay(ITasMovie movie, TasStateManager tsm) { _movie = movie; _tsm = tsm;