Nexus.Client.Games.GameModeRegistry.LoadInstalledGameModes C# (CSharp) Method

LoadInstalledGameModes() public static method

Loads the factories for games that have been previously detected as installed.
public static LoadInstalledGameModes ( GameModeRegistry p_gmrSupportedGameModes, EnvironmentInfo p_eifEnvironmentInfo ) : GameModeRegistry
p_gmrSupportedGameModes GameModeRegistry A registry containing the factories for all supported game modes.
p_eifEnvironmentInfo EnvironmentInfo The application's envrionment info.
return GameModeRegistry
		public static GameModeRegistry LoadInstalledGameModes(GameModeRegistry p_gmrSupportedGameModes, EnvironmentInfo p_eifEnvironmentInfo)
		{
			Trace.TraceInformation("Loading Game Mode Factories for Installed Games...");
			Trace.Indent();
			
			GameModeRegistry gmrInstalled = new GameModeRegistry();
			foreach (string strGameId in p_eifEnvironmentInfo.Settings.InstalledGames)
			{
				Trace.Write(String.Format("Loading {0}: ", strGameId));
				if (p_gmrSupportedGameModes.IsRegistered(strGameId))
				{
					Trace.WriteLine("Supported");
					gmrInstalled.RegisterGameMode(p_gmrSupportedGameModes.GetGameMode(strGameId));
				}
				else
					Trace.WriteLine("Not Supported");
			}
			
			Trace.Unindent();
			return gmrInstalled;
		}