예제 #1
0
        /// <summary>
        /// Where the program starts. Starts logging if necessary and runs game loop.
        /// </summary>
        private static void Main(string[] args)
        {
            var mugenOptions   = new MugenOptions();
            var shouldShowHelp = false;
            var options        = new OptionSet
            {
                { "h|help", "Displays help", h => shouldShowHelp = h != null },
                { "p3|player3=", "Loads a character named VALUE as player3", name => mugenOptions.Player3 = name },
                { "p4|player4=", "Loads a character named VALUE as player4", name => mugenOptions.Player4 = name },
                { "s|stage=", "Loads a stage named VALUE.def in stages/", s => mugenOptions.Stage = s },
            };

            try
            {
                // parse the command line
                var extra = options.Parse(args);
                if (extra.Count > 1)
                {
                    mugenOptions.Player1 = extra[0];
                    mugenOptions.Player2 = extra[1];
                }
                else if (extra.Count > 0)
                {
                    mugenOptions.Player1 = extra[0];
                }
            }
            catch (OptionException e)
            {
                // output some error message
                Console.Write("xnaMugen: ");
                Console.WriteLine(e.Message);
                Console.WriteLine("Try `xnaMugen --help' for more information.");
                return;
            }

            if (shouldShowHelp)
            {
                ShowHelp(options);
                return;
            }
#if DEBUG
            Log.Start();
            using (Game g = new Mugen(mugenOptions)) g.Run();
#else
            try
            {
                Log.Start();
                using (Game g = new Mugen(mugenOptions)) g.Run();
            }
            catch (Exception e)
            {
                Log.WriteException(e);

                System.Windows.Forms.MessageBox.Show(e.ToString(), "xnaMugen");
            }
#endif
        }
예제 #2
0
        /// <summary>
        /// Where the program starts. Starts logging if necessary and runs game loop.
        /// </summary>
        static void Main(String[] args)
        {
#if TEST
            using (Game g = new MugenTest()) g.Run();
#elif DEBUG
            Log.Start();
            using (Game g = new Mugen(args)) g.Run();
#else
            try
            {
                Log.Start();
                using (Game g = new Mugen(args)) g.Run();
            }
            catch (Exception e)
            {
                Log.WriteException(e);

                System.Windows.Forms.MessageBox.Show(e.ToString(), "xnaMugen");
            }
#endif
        }
예제 #3
0
		/// <summary>
		/// Where the program starts. Starts logging if necessary and runs game loop.
		/// </summary>
		static void Main(String[] args)
		{
#if TEST
			using (Game g = new MugenTest()) g.Run();
#elif DEBUG
			Log.Start(); 
			using (Game g = new Mugen(args)) g.Run();
#else
			try
			{
				Log.Start();
				using (Game g = new Mugen(args)) g.Run();
			}
			catch (Exception e)
			{
				Log.WriteException(e);

				System.Windows.Forms.MessageBox.Show(e.ToString(), "xnaMugen");
			}
#endif
		}