public static void Serialize(HearthstoneReplay replay, string filePath) { var ns = new XmlSerializerNamespaces(); ns.Add("", ""); var settings = new XmlWriterSettings {CloseOutput = true, Indent = true, IndentChars = "\t"}; using(TextWriter writer = new StreamWriter(filePath)) using(var xmlWriter = XmlWriter.Create(writer, settings)) { xmlWriter.WriteStartDocument(); xmlWriter.WriteDocType("hsreplay", null, string.Format(@"http://hearthsim.info/hsreplay/dtd/hsreplay-{0}.dtd", replay.Version), null); Serializer.Serialize(xmlWriter, replay, ns); xmlWriter.WriteEndDocument(); } }
public static void Serialize(HearthstoneReplay replay, string filePath) { var ns = new XmlSerializerNamespaces(); ns.Add("", ""); var settings = new XmlWriterSettings { CloseOutput = true, Indent = true, IndentChars = "\t" }; using (TextWriter writer = new StreamWriter(filePath)) using (var xmlWriter = XmlWriter.Create(writer, settings)) { xmlWriter.WriteStartDocument(); xmlWriter.WriteDocType("hsreplay", null, string.Format(@"http://hearthsim.info/hsreplay/dtd/hsreplay-{0}.dtd", replay.Version), null); Serializer.Serialize(xmlWriter, replay, ns); xmlWriter.WriteEndDocument(); } }
public Replay(string filePath) { _replay = ReplaySerializer.Deserialize(filePath); }
public Replay(HearthstoneReplay replay) { _replay = replay; }
public void Reset() { Replay = new HearthstoneReplay(); CurrentGame = new Game(); }