BizHawk/BizHawk.MultiClient/movie/MovieHeader.cs

85 lines
3.0 KiB
C#
Raw Normal View History

2011-02-24 22:25:53 +00:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace BizHawk.MultiClient
{
class MovieHeader
{
//Required Header Params
//Emulation - Core version, will be 1.0.0 until there is a versioning system
//Movie - Versioning for the Movie code itself, or perhaps this could be changed client version?
//Platform - Must know what platform we are making a movie on!
//GameName - Which game
//TODO: GUID, checksum of game, other stuff
public Dictionary<string, string> HeaderParams = new Dictionary<string, string>(); //Platform specific options go here
public List<string> Comments = new List<string>();
public const string EMULATIONVERSION = "EmulationVersion";
public const string MOVIEVERSION = "MovieVersion";
public const string PLATFORM = "Platform";
public const string GAMENAME = "GameName";
public const string AUTHOR = "Author";
2011-05-12 17:29:34 +00:00
public const string RERECORDS = "Rerecords";
public static string MovieVersion = "BizHawk v0.0.1";
2011-02-24 22:25:53 +00:00
public MovieHeader() //All required fields will be set to default values
{
2011-05-12 17:29:34 +00:00
HeaderParams.Add(EMULATIONVERSION, "BizHawk v1.0.0");
HeaderParams.Add(MOVIEVERSION, MovieVersion);
HeaderParams.Add(PLATFORM, "");
HeaderParams.Add(GAMENAME, "");
HeaderParams.Add(AUTHOR, "");
2011-05-12 17:29:34 +00:00
HeaderParams.Add(RERECORDS, "0");
2011-02-24 22:25:53 +00:00
}
2011-05-12 17:29:34 +00:00
public MovieHeader(string EmulatorVersion, string MovieVersion, string Platform, string GameName, string Author, int rerecords)
2011-02-24 22:25:53 +00:00
{
2011-05-12 17:29:34 +00:00
HeaderParams.Add(EMULATIONVERSION, EmulatorVersion);
HeaderParams.Add(MOVIEVERSION, MovieVersion);
HeaderParams.Add(PLATFORM, Platform);
HeaderParams.Add(GAMENAME, GameName);
HeaderParams.Add(AUTHOR, Author);
HeaderParams.Add(RERECORDS, rerecords.ToString());
2011-02-24 22:25:53 +00:00
}
/// <summary>
/// Adds the key value pair to header params. If key already exists, value will be updated
/// </summary>
/// <param name="key"></param>
/// <param name="value"></param>
public void AddHeaderLine(string key, string value) //TODO: check for redundancy and return bool?
{
string temp = value;
if (!HeaderParams.TryGetValue(key, out temp)) //TODO: does a failed attempt mess with value?
2011-02-24 22:25:53 +00:00
HeaderParams.Add(key, value);
}
public void UpdateRerecordCount(int count)
{
//TODO
}
2011-02-24 22:25:53 +00:00
public bool RemoveHeaderLine(string key)
{
return HeaderParams.Remove(key);
}
public void Clear()
{
HeaderParams.Clear();
}
2011-02-24 22:25:53 +00:00
public string GetHeaderLine(string key)
{
string value = "";
HeaderParams.TryGetValue(key, out value);
return value;
}
}
}