using System.Reflection; using System.Xml; namespace BOTWM.Server { static public class readXML { static public Dictionary> readAnimationFile() { Dictionary> result = new Dictionary>(); XmlTextReader reader = new XmlTextReader(new StringReader(Resources.animationHashes)); Dictionary animation = new Dictionary(); Dictionary animationCopy = new Dictionary(); string[] acceptedStrings = { "Hash", "Schedule", "Animation", "Name" }; string next = ""; string hash = ""; animation.Add("Schedule", ""); animation.Add("Animation", ""); animation.Add("Name", ""); while (reader.Read()) { switch (reader.NodeType) { case XmlNodeType.Element: if (acceptedStrings.Contains(reader.Name)) { next = reader.Name; } break; case XmlNodeType.Text: if (next != "") { if (next == "Hash") { hash = reader.Value; } else { animation[next] = reader.Value; if (next == "Animation") { animationCopy = new Dictionary(animation); result.Add(hash, animationCopy); next = ""; } } } break; } } reader.Close(); return result; } } }