Example #1
0
		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();
			}
		}
Example #2
0
        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();
                }
        }
Example #3
0
 public Replay(string filePath)
 {
     _replay = ReplaySerializer.Deserialize(filePath);
 }
Example #4
0
 public Replay(HearthstoneReplay replay)
 {
     _replay = replay;
 }
Example #5
0
 public Replay(string filePath)
 {
     _replay = ReplaySerializer.Deserialize(filePath);
 }
Example #6
0
 public Replay(HearthstoneReplay replay)
 {
     _replay = replay;
 }
Example #7
0
 public void Reset()
 {
     Replay      = new HearthstoneReplay();
     CurrentGame = new Game();
 }
Example #8
0
 public void Reset()
 {
     Replay = new HearthstoneReplay();
     CurrentGame = new Game();
 }