protected override void AddResultToDictionary(IDictionary <string, object> dictionary, string key, XElement xmlValue)
            {
                string type  = xmlValue.Attribute("type").Value;
                var    value = GameLoader.ReadXmlValue(type, xmlValue);

                dictionary.Add(key, value);
            }
Esempio n. 2
0
            private QuestList <object> LoadQuestList(XElement xml)
            {
                var result = new QuestList <object>();

                foreach (var xmlValue in xml.Elements("value"))
                {
                    var    typeAttr = xmlValue.Attribute("type");
                    string type     = typeAttr != null ? typeAttr.Value : null;
                    var    value    = GameLoader.ReadXmlValue(type, xmlValue);

                    result.Add(value);
                }
                return(result);
            }
            private QuestList <object> LoadQuestList(XElement xml)
            {
                var result = new QuestList <object>();

                foreach (var xmlValue in xml.Elements("value"))
                {
                    var typeAttribute = xmlValue.Attribute("type");
                    if (typeAttribute == null)
                    {
                        throw new Exception("Type not specified for value " + xmlValue);
                    }
                    string type  = typeAttribute.Value;
                    var    value = GameLoader.ReadXmlValue(type, xmlValue);

                    result.Add(value);
                }
                return(result);
            }