using System;
using System.Collections.Generic;
using System.IO;
namespace BizHawk.Client.Common
{
public interface IStateManager
{
///
/// Retrieves the savestate for the given frame,
/// If this frame does not have a state currently, will return an empty array
///
/// A savestate for the given frame or an empty array if there isn't one
byte[] this[int frame] { get; }
TasStateManagerSettings Settings { get; set; }
Action InvalidateCallback { set; }
///
/// Requests that the current emulator state be captured
/// Unless force is true, the state may or may not be captured depending on the logic employed by "green-zone" management
///
void Capture(bool force = false);
bool HasState(int frame);
///
/// Clears out all savestates after the given frame number
///
bool Invalidate(int frame);
void Clear();
void Save(BinaryWriter bw);
void Load(BinaryReader br);
KeyValuePair GetStateClosestToFrame(int frame);
bool Any();
int Count { get; }
int Last { get; }
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
///
bool Remove(int frame);
}
}