예제 #1
0
        private static void WriteCurrentOptions(StreamWriter outFile)
        {
            if (debugWholeOptions)
            {
                outFile.WriteLine(currentOptions);
                return;
            }

            var options = currentOptions.ToString().Split(new[] { "@" }, StringSplitOptions.RemoveEmptyEntries);

            for (int i = 0; i < options.Length - 1; i++)
            {
                if (debugIndividualOptions)
                {
                    outFile.WriteLine("\t\t\t\t<option>" + options[i] + "</option>");
                    continue;
                }

                var name   = options[i].Trim();
                var points = RemoveNonNumericConvertFree(options[i + 1].Trim().Split(' ')[0]);  // first value on next option line is the points for the current one, because of "@" split

                outFile.WriteLine("\t\t\t\t<option>");

                // Have to handle ammo types specially
                if (ammoTypes.Contains(name))
                {
                    points = WriteAmmoTypes(outFile, points, options[i], options[i + 1]);
                }
                else
                {
                    WriteOptionName(outFile, name);
                }

                outFile.WriteLine("\t\t\t\t\t<points>" + points + "</points>");
                outFile.WriteLine("\t\t\t\t</option>");
            }

            if (debugIndividualOptions)  // output the last line for debugging
            {
                outFile.WriteLine("\t\t\t\t<not-option>" + options[options.Length - 1] + "</not-option>");
            }
        }