idTech4.idSystem.LoadGameDLL C# (CSharp) Method

LoadGameDLL() private method

private LoadGameDLL ( ) : void
return void
		private void LoadGameDLL()
		{
			// from executable directory first - this is handy for developement
			string dllName = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
			dllName = Path.Combine(dllName, "game.dll");

			if(File.Exists(dllName) == false)
			{
				dllName = null;
			}

			if(dllName == null)
			{
				dllName = idE.FileSystem.RelativePathToOSPath("game.dll", "fs_savedir");
			}

			idConsole.DeveloperWriteLine("Loading game DLL: '{0}'", dllName);

			Assembly asm = Assembly.LoadFile(Path.GetFullPath(dllName));
			
			idE.Game = (idBaseGame) asm.CreateInstance("idTech4.Game.idGame");
			idE.GameEdit = (idBaseGameEdit) asm.CreateInstance("idTech4.Game.idGameEdit");

			idE.Game.Init();
		}