BizHawk/BizHawk.Client.Common/movie/MovieRecord.cs

54 lines
969 B
C#
Raw Normal View History

2014-01-11 15:05:41 +00:00
using System.Collections.Generic;
using System.Linq;
namespace BizHawk.Client.Common
{
public class MovieRecord
{
2013-12-09 17:24:32 +00:00
private byte[] _state = new byte[0];
public MovieRecord(string serializedInput, bool captureState)
{
SerializedInput = serializedInput;
if (captureState)
{
CaptureSate();
}
}
public string SerializedInput { get; private set; }
public bool Lagged { get; private set; }
public void ClearInput()
{
SerializedInput = string.Empty;
}
public void SetInput(string input)
{
SerializedInput = input ?? string.Empty;
}
public void CaptureSate()
{
Lagged = Global.Emulator.IsLagFrame;
2013-12-23 20:34:02 +00:00
_state = (byte[])Global.Emulator.SaveStateBinary().Clone();
}
public IEnumerable<byte> State
2013-12-09 17:24:32 +00:00
{
get { return _state; }
2013-12-09 17:24:32 +00:00
}
public bool HasState
{
get { return State.Any(); }
}
public void ClearState()
{
_state = new byte[0];
}
}
}