/// <summary> /// A simple constructor that initializes the object with its dependencies. /// </summary> /// <param name="p_gmdGameMode">The current game mode.</param> /// <param name="p_mprManagedPluginRegistry">The <see cref="PluginRegistry"/> that contains the list /// of managed <see cref="Plugin"/>s.</param> /// <param name="p_aplPluginLog">The <see cref="ActivePluginLog"/> tracking plugin activations for the /// current game mode.</param> /// <param name="p_polOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the /// current game mode.</param> /// <param name="p_povOrderValidator">The object that validates plugin order.</param> private PluginManager(IGameMode p_gmdGameMode, PluginRegistry p_mprManagedPluginRegistry, ActivePluginLog p_aplPluginLog, IPluginOrderLog p_polOrderLog, IPluginOrderValidator p_povOrderValidator) { GameMode = p_gmdGameMode; ManagedPluginRegistry = p_mprManagedPluginRegistry; ActivePluginLog = p_aplPluginLog; PluginOrderLog = p_polOrderLog; OrderValidator = p_povOrderValidator; if (GameMode.OrderedCriticalPluginNames != null) { foreach (string strPlugin in GameMode.OrderedCriticalPluginNames) ActivePluginLog.ActivatePlugin(strPlugin); List<Plugin> lstPlugins = new List<Plugin>(PluginOrderLog.OrderedPlugins); if (!OrderValidator.ValidateOrder(lstPlugins)) { OrderValidator.CorrectOrder(lstPlugins); PluginOrderLog.SetPluginOrder(lstPlugins); } } }