void ProcessTagStructs(BlamLib.CheApe.ProjectState state, IO.XmlStream s) { foreach (XmlNode n in s.Cursor.ChildNodes) { if (n.Name != "Struct") { continue; } s.SaveCursor(n); var block = new TagStruct(state, s); s.RestoreCursor(); string name_str = block.ToString(); try { Structs.Add(name_str, block); } catch (ArgumentException) { Debug.LogFile.WriteLine(CheApe.Import.kDuplicateErrorStr, "tag struct definition", name_str); } } }
protected override void ProcessDefinition(XmlNode node, BlamLib.CheApe.ProjectState state, BlamLib.IO.XmlStream s) { StringIdFieldsInitialize(state); string name_str; switch (node.Name) { #region Tag Structs case "structs": s.SaveCursor(node); foreach (XmlNode n in s.Cursor.ChildNodes) { if (n.Name != "Struct") continue; s.SaveCursor(n); TagStruct block = new TagStruct(state, s); s.RestoreCursor(); name_str = block.ToString(); try { Structs.Add(name_str, block); } catch (ArgumentException) { Debug.LogFile.WriteLine(CheApe.Import.kDuplicateErrorStr, "tag struct definition", name_str); } } s.RestoreCursor(); break; #endregion #region Tag Blocks case "blocks": s.SaveCursor(node); foreach (XmlNode n in s.Cursor.ChildNodes) { if (n.Name != "TagBlock") continue; s.SaveCursor(n); TagBlock block = new TagBlock(state, s); s.RestoreCursor(); name_str = block.ToString(); try { Blocks.Add(name_str, block); } catch (ArgumentException) { Debug.LogFile.WriteLine(CheApe.Import.kDuplicateErrorStr, "tag block definition", name_str); } } s.RestoreCursor(); break; #endregion #region Tag Groups case "groups": s.SaveCursor(node); foreach (XmlNode n in s.Cursor.ChildNodes) { if (n.Name != "TagGroup") continue; s.SaveCursor(n); TagGroup group = new TagGroup(state, s); s.RestoreCursor(); name_str = group.ToString(); try { Groups.Add(name_str, group); } catch (ArgumentException) { Debug.LogFile.WriteLine(CheApe.Import.kDuplicateErrorStr, "tag group definition", name_str); } } s.RestoreCursor(); break; #endregion } }
protected override void ProcessDefinition(XmlNode node, BlamLib.CheApe.ProjectState state, BlamLib.IO.XmlStream s) { StringIdFieldsInitialize(state); string name_str; switch (node.Name) { #region Tag Structs case "structs": s.SaveCursor(node); foreach (XmlNode n in s.Cursor.ChildNodes) { if (n.Name != "Struct") { continue; } s.SaveCursor(n); TagStruct block = new TagStruct(state, s); s.RestoreCursor(); name_str = block.ToString(); try { Structs.Add(name_str, block); } catch (ArgumentException) { Debug.LogFile.WriteLine(CheApe.Import.kDuplicateErrorStr, "tag struct definition", name_str); } } s.RestoreCursor(); break; #endregion #region Tag Blocks case "blocks": s.SaveCursor(node); foreach (XmlNode n in s.Cursor.ChildNodes) { if (n.Name != "TagBlock") { continue; } s.SaveCursor(n); TagBlock block = new TagBlock(state, s); s.RestoreCursor(); name_str = block.ToString(); try { Blocks.Add(name_str, block); } catch (ArgumentException) { Debug.LogFile.WriteLine(CheApe.Import.kDuplicateErrorStr, "tag block definition", name_str); } } s.RestoreCursor(); break; #endregion #region Tag Groups case "groups": s.SaveCursor(node); foreach (XmlNode n in s.Cursor.ChildNodes) { if (n.Name != "TagGroup") { continue; } s.SaveCursor(n); TagGroup group = new TagGroup(state, s); s.RestoreCursor(); name_str = group.ToString(); try { Groups.Add(name_str, group); } catch (ArgumentException) { Debug.LogFile.WriteLine(CheApe.Import.kDuplicateErrorStr, "tag group definition", name_str); } } s.RestoreCursor(); break; #endregion } }
void ProcessTagStructs(BlamLib.CheApe.ProjectState state, IO.XmlStream s) { foreach (XmlNode n in s.Cursor.ChildNodes) { if (n.Name != "Struct") continue; s.SaveCursor(n); var block = new TagStruct(state, s); s.RestoreCursor(); string name_str = block.ToString(); try { Structs.Add(name_str, block); } catch (ArgumentException) { Debug.LogFile.WriteLine(CheApe.Import.kDuplicateErrorStr, "tag struct definition", name_str); } } }