Ejemplo n.º 1
0
        /// <summary> Takes a string[] generated from opener and extracts the line that contains
        /// the customer info </summary>
        /// <returns> The customer information as a single string, error message if
        /// no such string is found</returns>
        private static string GetCustomerInfo(string filename)
        {
            string[] file       = Opener.FileToStringList(filename);
            string   identifier = "Customer:";
            string   error      = "Customer not found.";

            foreach (string elm in file)
            {
                if (elm.Contains(identifier))
                {
                    return(elm);
                }
            }

            return(error);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the platform names from the level file
        /// </summary>
        /// <param name="filename">
        /// File path
        /// </param>
        /// <returns>
        /// String array with all the platforms in a given map
        /// </returns>
        public static string[] Platforms(string filename)
        {
            string platform = "";

            string[] file       = Opener.FileToStringList(filename);
            string   identifier = "Platforms:";

            foreach (string elm in file)
            {
                if (elm.Contains(identifier))
                {
                    platform = elm;
                }
            }

            platform = Regex.Replace(platform, ",", "");
            platform = Regex.Replace(platform, "Platforms:", "");

            return(platform.Split());
        }