예제 #1
0
 /// <summary>
 ///     Loads an engine database from an XML container.
 /// </summary>
 /// <param name="container">The container to read engine elements from.</param>
 /// <returns>The built engine database.</returns>
 public static EngineDatabase LoadDatabase(XContainer container)
 {
     XMLSettingsGroupLoader loader = CreateSettingsGroupLoader();
     var result = new EngineDatabase();
     foreach (XElement elem in container.Elements("engine"))
     {
         string name = XMLUtil.GetStringAttribute(elem, "name");
         int levlSize = XMLUtil.GetNumericAttribute(elem, "levlSize");
         int version = XMLUtil.GetNumericAttribute(elem, "version");
         SettingsGroup settings = loader.LoadSettingsGroup(elem);
         var desc = new EngineDescription(name, levlSize, version, settings);
         result.RegisterEngine(desc);
     }
     return result;
 }
예제 #2
0
        /// <summary>
        ///     Loads an engine database from an XML container.
        /// </summary>
        /// <param name="container">The container to read engine elements from.</param>
        /// <returns>The built engine database.</returns>
        public static EngineDatabase LoadDatabase(XContainer container)
        {
            XMLSettingsGroupLoader loader = CreateSettingsGroupLoader();
            var result = new EngineDatabase();

            foreach (XElement elem in container.Elements("engine"))
            {
                string        name     = XMLUtil.GetStringAttribute(elem, "name");
                int           levlSize = (int)XMLUtil.GetNumericAttribute(elem, "levlSize");
                int           version  = (int)XMLUtil.GetNumericAttribute(elem, "version");
                SettingsGroup settings = loader.LoadSettingsGroup(elem);
                var           desc     = new EngineDescription(name, levlSize, version, settings);
                result.RegisterEngine(desc);
            }
            return(result);
        }