Example #1
0
		static int Main ( string[] args )
		{
			// 	colored console output :
			Log.AddListener( new ColoredLogListener() );
			
			//	output for in-game console :
			Log.AddListener( new LogRecorder() );

			//	set verbosity :
			Log.VerbosityLevel	=	LogMessageType.Verbose;


			//
			//	Build content on startup.
			//	Remove this line in release code.
			//
			Builder.Options.InputDirectory	=	@"..\..\..\Content";
			Builder.Options.TempDirectory	=	@"..\..\..\Temp";
			Builder.Options.OutputDirectory	=	@"Content";
			Builder.SafeBuild();


			//
			//	Run game :
			//
			using ( var game = new Game("$safeprojectname$") ) {

				//	create SV, CL and UI instances :
				game.GameServer		=	new $safeprojectname$Server(game);
				game.GameClient		=	new $safeprojectname$Client(game);
				game.GameInterface	=	new $safeprojectname$Interface(game);

				//	load configuration.
				//	first run will cause warning, 
				//	because configuration file still does not exist.
				game.LoadConfiguration("Config.ini");

				//	enable and disable debug direct3d device :
				game.RenderSystem.Config.UseDebugDevice =	false;

				//	enable and disable object tracking :
				game.TrackObjects	= true;

				//	set game title :
				game.GameTitle = "$safeprojectname$";

				//	apply command-line options here:
				//	...

				//	run:
				game.Run();
				
				//	save configuration :
				game.SaveConfiguration("Config.ini"); 				
			}

			return 0;
		}