Some simplifying of IMovieHeader

This commit is contained in:
adelikat 2014-06-11 00:21:14 +00:00
parent 710e461165
commit e07c7a776f
5 changed files with 21 additions and 64 deletions

View File

@ -7,16 +7,6 @@ namespace BizHawk.Client.Common
{ {
public class MovieHeader2 : IMovieHeader public class MovieHeader2 : IMovieHeader
{ {
public SubtitleList Subtitles
{
get { throw new NotImplementedException(); }
}
public List<string> Comments
{
get { throw new NotImplementedException(); }
}
public ulong Rerecords public ulong Rerecords
{ {
get get
@ -77,18 +67,6 @@ namespace BizHawk.Client.Common
} }
} }
public string SyncSettingsJson
{
get
{
throw new NotImplementedException();
}
set
{
throw new NotImplementedException();
}
}
public bool ParseLineFromFile(string line) public bool ParseLineFromFile(string line)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
@ -180,5 +158,19 @@ namespace BizHawk.Client.Common
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
#region Won't implement
public SubtitleList Subtitles
{
get { throw new NotImplementedException(); }
}
public List<string> Comments
{
get { throw new NotImplementedException(); }
}
#endregion
} }
} }

View File

@ -47,12 +47,12 @@ namespace BizHawk.Client.Common
public SubtitleList Subtitles public SubtitleList Subtitles
{ {
get { return Header.Subtitles; } get { return (Header as MovieHeader).Subtitles; }
} }
public IList<string> Comments public IList<string> Comments
{ {
get { return Header.Comments; } get { return (Header as MovieHeader).Comments; }
} }
public string SyncSettingsJson public string SyncSettingsJson
@ -356,7 +356,7 @@ namespace BizHawk.Client.Common
if (string.IsNullOrWhiteSpace(line) || Header.ParseLineFromFile(line)) if (string.IsNullOrWhiteSpace(line) || Header.ParseLineFromFile(line))
continue; continue;
Header.Comments.Add(line); (Header as MovieHeader).Comments.Add(line);
} }
} }
@ -410,7 +410,7 @@ namespace BizHawk.Client.Common
} }
else else
{ {
Header.Comments.Add(line); (Header as MovieHeader).Comments.Add(line);
} }
} }
} }

View File

@ -33,24 +33,6 @@ namespace BizHawk.Client.Common
} }
} }
public string SyncSettingsJson
{
get
{
if (ContainsKey(HeaderKeys.SYNCSETTINGS))
{
return this[HeaderKeys.SYNCSETTINGS];
}
return string.Empty;
}
set
{
this[HeaderKeys.SYNCSETTINGS] = value;
}
}
public ulong Rerecords public ulong Rerecords
{ {
get get

View File

@ -4,15 +4,11 @@ namespace BizHawk.Client.Common
{ {
public interface IMovieHeader : IDictionary<string, string> public interface IMovieHeader : IDictionary<string, string>
{ {
SubtitleList Subtitles { get; }
List<string> Comments { get; }
ulong Rerecords { get; set; } ulong Rerecords { get; set; }
bool StartsFromSavestate { get; set; } bool StartsFromSavestate { get; set; }
string SavestateBinaryBase64Blob { get; set; } string SavestateBinaryBase64Blob { get; set; }
string GameName { get; set; } string GameName { get; set; }
string SystemID { get; set; } string SystemID { get; set; }
string SyncSettingsJson { get; set; }
/// <summary> /// <summary>
/// Receives a line and attempts to add as a header /// Receives a line and attempts to add as a header

View File

@ -88,25 +88,12 @@ namespace BizHawk.Client.Common
public SubtitleList Subtitles public SubtitleList Subtitles
{ {
get { return Header.Subtitles; } get { return (Header as MovieHeader).Subtitles; }
} }
public IList<string> Comments public IList<string> Comments
{ {
get { return Header.Comments; } get { return (Header as MovieHeader).Comments; }
}
public string SyncSettingsJson
{
get
{
return Header[HeaderKeys.SYNCSETTINGS];
}
set
{
Header[HeaderKeys.SYNCSETTINGS] = value;
}
} }
public string Filename { get; set; } public string Filename { get; set; }
@ -336,7 +323,7 @@ namespace BizHawk.Client.Common
string line; string line;
while ((line = tr.ReadLine()) != null) while ((line = tr.ReadLine()) != null)
if (!Header.ParseLineFromFile(line)) if (!Header.ParseLineFromFile(line))
Header.Comments.Add(line); (Header as MovieHeader).Comments.Add(line);
}); });
bl.GetLump(BinaryStateLump.Input, true, bl.GetLump(BinaryStateLump.Input, true,
delegate(TextReader tr) delegate(TextReader tr)