예제 #1
0
        internal static CategorySettings FromXml(XmlElement categoryElement)
        {
            string name             = SettingsHelper.ParseString(categoryElement[nameof(Name)]);
            var    categorySettings = new CategorySettings(name);

            foreach (var splitElement in categoryElement[SplitsElementName].ChildNodes.Cast <XmlElement>())
            {
                string segmentName   = SettingsHelper.ParseString(splitElement[SegmentNameElementName]);
                string autosplitName = SettingsHelper.ParseString(splitElement[AutosplitNameElementName]);
                categorySettings.SplitMap[segmentName] = autosplitName;
            }

            return(categorySettings);
        }
예제 #2
0
        internal static GameSettings FromXml(XmlElement gameElement)
        {
            string name       = SettingsHelper.ParseString(gameElement[nameof(Name)]);
            string configFile = SettingsHelper.ParseString(gameElement[nameof(ConfigFile)]);

            var gameSettings = new GameSettings(name, configFile);

            foreach (var categoryElement in gameElement[CategoriesElementName].ChildNodes.Cast <XmlElement>())
            {
                CategorySettings categorySettings = CategorySettings.FromXml(categoryElement);
                gameSettings.CategoryMap[categorySettings.Name] = categorySettings;
            }

            return(gameSettings);
        }