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

IsRegistered() public method

Determines if the specified game mode is in the registry.
public IsRegistered ( string p_strGameModeId ) : bool
p_strGameModeId string The id of the game mode whose presence in the registry is to be determined.
return bool
		public bool IsRegistered(string p_strGameModeId)
		{
			return m_dicGameModeFactories.ContainsKey(p_strGameModeId);
		}

Usage Example

        /// <summary>
        /// Loads the factories for games that have been previously detected as installed.
        /// </summary>
        /// <param name="supportedGameModes">A registry containing the factories for all supported game modes.</param>
        /// <param name="environmentInfo">The application's environment info.</param>
        /// <returns>A registry containing all of the game mode factories for games that were previously detected as installed.</returns>
        public static GameModeRegistry LoadInstalledGameModes(GameModeRegistry supportedGameModes, EnvironmentInfo environmentInfo)
        {
            Trace.TraceInformation("Loading Game Mode Factories for Installed Games...");
            Trace.Indent();

            var installedGameModes = new GameModeRegistry();

            foreach (var gameId in environmentInfo.Settings.InstalledGames)
            {
                Trace.Write($"Loading {gameId}: ");

                if (supportedGameModes.IsRegistered(gameId))
                {
                    Trace.WriteLine("Supported");
                    installedGameModes.RegisterGameMode(supportedGameModes.GetGameMode(gameId));
                }
                else
                {
                    Trace.WriteLine("Not Supported");
                }
            }

            Trace.Unindent();
            return(installedGameModes);
        }
All Usage Examples Of Nexus.Client.Games.GameModeRegistry::IsRegistered