Пример #1
0
        /// <summary>
        /// Parses a line in con file format, and adds the map to the entry list if its valid
        /// </summary>
        /// <param name="Line">The con file formated string to parse</param>
        /// <returns>Returns whether the line was successfully parsed</returns>
        public bool AddFromString(string Line)
        {
            // Parse the 1st line of the con file
            Match M = Regex.Match(Line, Expression, RegexOptions.IgnoreCase);
            if (M.Success)
            {
                MapListEntry Entry = new MapListEntry();
                Entry.MapName = M.Groups["Mapname"].Value;
                Entry.GameMode = M.Groups["Gamemode"].Value;
                Entry.MapSize = Int32.Parse(M.Groups["Size"].Value);
                Entries.Add(Entry);
            }

            return M.Success;
        }
Пример #2
0
        /// <summary>
        /// Parses a line in con file format, and adds the map to the entry list if its valid
        /// </summary>
        /// <param name="Line">The con file formated string to parse</param>
        /// <returns>Returns whether the line was successfully parsed</returns>
        public bool AddFromString(string Line)
        {
            // Parse the 1st line of the con file
            Match M = Regex.Match(Line, Expression, RegexOptions.IgnoreCase);

            if (M.Success)
            {
                MapListEntry Entry = new MapListEntry();
                Entry.MapName  = M.Groups["Mapname"].Value;
                Entry.GameMode = M.Groups["Gamemode"].Value;
                Entry.MapSize  = Int32.Parse(M.Groups["Size"].Value);
                Entries.Add(Entry);
            }

            return(M.Success);
        }