Example #1
0
        static void Main(string[] args)
        {
            int    stars       = 1;
            string displaymode = string.Empty;

            argParser = new ArgumentParser(args);

            if (int.TryParse(argParser.GetArgValue("stars"), out stars))
            {
                if (stars == 0)
                {
                    stars = 1;
                }
            }
            displaymode = argParser.GetArgValue("disp");

            switch (displaymode)
            {
            case "xml":

                SystemDisplayXml sdx = new SystemDisplayXml();

                for (int i = 1; i <= stars; i++)
                {
                    starSystems.Add(new StarSystem());
                }
                sdx.SerializeXml(starSystems);
                break;

            case "ssx":

                SystemDisplaySsx ssx = new SystemDisplaySsx();
                starSystems.Add(new StarSystem());
                ssx.SerializeXml(starSystems);
                break;

            case "2d":
                SystemDisplay2D sd = new SystemDisplay2D(new StarSystem());
                sd.ShowDialog();
                break;

            case "viewer":
                Console.WriteLine("Not yet implemented");
                break;

            default:
                Console.WriteLine("Star system generator v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
                Console.WriteLine("accretesharp -disp [xml|2d] (-stars n)");
                Console.WriteLine(string.Empty);
                Console.WriteLine("-disp\t\tDisplay mode (currently supported only xml and 2d.");
                Console.WriteLine("\t\tXml dump output to console, pipe it using \">>\" to file.");
                Console.WriteLine("-stars\t\tNumber of stars to generate. Keep it below 1000, please.");
                Console.WriteLine("\t\tIgnored if -disp is set to 2d.");
                break;
            }
        }
Example #2
0
        static void Main(string[] args)
        {
            int stars = 1;
            string displaymode= string.Empty;
            argParser = new ArgumentParser(args);

            if (int.TryParse(argParser.GetArgValue("stars"), out stars))
            {
                if (stars == 0) { stars = 1; }
            }
            displaymode = argParser.GetArgValue("disp");

            switch (displaymode)
            {
                case "xml":

                    SystemDisplayXml sdx = new SystemDisplayXml();

                    for (int i = 1; i <= stars; i++)
                    {
                        starSystems.Add(new StarSystem());
                    }
                    sdx.SerializeXml(starSystems);
                    break;

                case "ssx":

                    SystemDisplaySsx ssx = new SystemDisplaySsx();
                    starSystems.Add(new StarSystem());
                    ssx.SerializeXml(starSystems);
                    break;

                case "2d":
                    SystemDisplay2D sd = new SystemDisplay2D(new StarSystem());
                    sd.ShowDialog();
                    break;

                case "viewer":
                    Console.WriteLine("Not yet implemented");
                    break;

                default:
                    Console.WriteLine("Star system generator v" + System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString());
                    Console.WriteLine("accretesharp -disp [xml|2d] (-stars n)");
                    Console.WriteLine(string.Empty);
                    Console.WriteLine("-disp\t\tDisplay mode (currently supported only xml and 2d.");
                    Console.WriteLine("\t\tXml dump output to console, pipe it using \">>\" to file.");
                    Console.WriteLine("-stars\t\tNumber of stars to generate. Keep it below 1000, please.");
                    Console.WriteLine("\t\tIgnored if -disp is set to 2d.");
                    break;
            }
        }