/// <summary>
		/// Initializes the singleton intances of the mod manager.
		/// </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>
		/// <exception cref="InvalidOperationException">Thrown if the plugin manager has already
		/// been initialized.</exception>
		public static IPluginManager Initialize(IGameMode p_gmdGameMode, PluginRegistry p_mprManagedPluginRegistry, ActivePluginLog p_aplPluginLog, IPluginOrderLog p_polOrderLog, IPluginOrderValidator p_povOrderValidator)
		{
			if (m_pmgCurrent != null)
				throw new InvalidOperationException("The Plugin Manager has already been initialized.");
			m_pmgCurrent = new PluginManager(p_gmdGameMode, p_mprManagedPluginRegistry, p_aplPluginLog, p_polOrderLog, p_povOrderValidator);
			return m_pmgCurrent;
		}
예제 #2
0
 /// <summary>
 /// Gets the serailizer that serializes and deserializes the list of active plugins
 /// for this game mode.
 /// </summary>
 /// <param name="p_polPluginOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the current game mode.</param>
 /// <returns>The serailizer that serializes and deserializes the list of active plugins
 /// for this game mode.</returns>
 public override IActivePluginLogSerializer GetActivePluginLogSerializer(IPluginOrderLog p_polPluginOrderLog)
 {
     if (m_apsActivePluginLogSerializer == null)
     {
         m_apsActivePluginLogSerializer = new GamebryoActivePluginLogSerializer(this, p_polPluginOrderLog, BossSorter);
     }
     return(m_apsActivePluginLogSerializer);
 }
예제 #3
0
 /// <summary>
 /// A simpell constructor that initializes the object with the given services.
 /// </summary>
 /// <param name="p_ilgModInstallLog">The install log that tracks mod install info for the current game mode.</param>
 /// <param name="p_aplActivePluginLog">The <see cref="ActivePluginLog"/> tracking plugin activations for the current game mode.</param>
 /// <param name="p_polPluginOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the current game mode.</param>
 /// <param name="p_mrpModRepository">The repository we are logging in to.</param>
 /// <param name="p_mmgModManager">The mod manager to use to manage mods.</param>
 /// <param name="p_pmgPluginManager">The manager to use to manage plugins.</param>
 /// <param name="p_amtMonitor">The download monitor to use to manage the monitored activities.</param>
 /// <param name="p_mamMonitor">The mod activation monitor to use to manage the monitored activities.</param>
 /// <param name="p_umgUpdateManager">The update manager to use to perform updates.</param>
 public ServiceManager(IInstallLog p_ilgModInstallLog, ActivePluginLog p_aplActivePluginLog, IPluginOrderLog p_polPluginOrderLog, IModRepository p_mrpModRepository, ModManager p_mmgModManager, IPluginManager p_pmgPluginManager, DownloadMonitor p_amtMonitor, ModActivationMonitor p_mamMonitor)
 {
     ModInstallLog        = p_ilgModInstallLog;
     ActivePluginLog      = p_aplActivePluginLog;
     PluginOrderLog       = p_polPluginOrderLog;
     ModRepository        = p_mrpModRepository;
     ModManager           = p_mmgModManager;
     PluginManager        = p_pmgPluginManager;
     DownloadMonitor      = p_amtMonitor;
     ModActivationMonitor = p_mamMonitor;
 }
예제 #4
0
        /// <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);
                }
            }
        }
예제 #5
0
 /// <summary>
 /// Gets the serailizer that serializes and deserializes the list of active plugins
 /// for this game mode.
 /// </summary>
 /// <param name="p_polPluginOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the current game mode.</param>
 /// <returns>The serailizer that serializes and deserializes the list of active plugins
 /// for this game mode.</returns>
 public override IActivePluginLogSerializer GetActivePluginLogSerializer(IPluginOrderLog p_polPluginOrderLog)
 {
     return(null);
 }
		/// <summary>
		/// Gets the serailizer that serializes and deserializes the list of active plugins
		/// for this game mode.
		/// </summary>
		/// <param name="p_polPluginOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the current game mode.</param>
		/// <returns>The serailizer that serializes and deserializes the list of active plugins
		/// for this game mode.</returns>
		public override IActivePluginLogSerializer GetActivePluginLogSerializer(IPluginOrderLog p_polPluginOrderLog)
		{
			if (m_apsActivePluginLogSerializer == null)
				m_apsActivePluginLogSerializer = new GamebryoActivePluginLogSerializer(this, p_polPluginOrderLog, PluginOrderManager);
			return m_apsActivePluginLogSerializer;
		}
예제 #7
0
		/// <summary>
		/// Gets the serailizer that serializes and deserializes the list of active plugins
		/// for this game mode.
		/// </summary>
		/// <param name="p_polPluginOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the current game mode.</param>
		/// <returns>The serailizer that serializes and deserializes the list of active plugins
		/// for this game mode.</returns>
		public abstract IActivePluginLogSerializer GetActivePluginLogSerializer(IPluginOrderLog p_polPluginOrderLog);
		/// <summary>
		/// Gets the serailizer that serializes and deserializes the list of active plugins
		/// for this game mode.
		/// </summary>
		/// <param name="p_polPluginOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the current game mode.</param>
		/// <returns>The serailizer that serializes and deserializes the list of active plugins
		/// for this game mode.</returns>
		public override IActivePluginLogSerializer GetActivePluginLogSerializer(IPluginOrderLog p_polPluginOrderLog)
		{
			return null;
		}
예제 #9
0
 /// <summary>
 /// Initializes the singleton intances of the mod manager.
 /// </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>
 /// <exception cref="InvalidOperationException">Thrown if the plugin manager has already
 /// been initialized.</exception>
 public static IPluginManager Initialize(IGameMode p_gmdGameMode, PluginRegistry p_mprManagedPluginRegistry, ActivePluginLog p_aplPluginLog, IPluginOrderLog p_polOrderLog, IPluginOrderValidator p_povOrderValidator)
 {
     if (m_pmgCurrent != null)
     {
         throw new InvalidOperationException("The Plugin Manager has already been initialized.");
     }
     m_pmgCurrent = new PluginManager(p_gmdGameMode, p_mprManagedPluginRegistry, p_aplPluginLog, p_polOrderLog, p_povOrderValidator);
     return(m_pmgCurrent);
 }
예제 #10
0
		/// <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);
                }
            }		
		}
예제 #11
0
 /// <summary>
 /// Gets the serailizer that serializes and deserializes the list of active plugins
 /// for this game mode.
 /// </summary>
 /// <param name="p_polPluginOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the current game mode.</param>
 /// <returns>The serailizer that serializes and deserializes the list of active plugins
 /// for this game mode.</returns>
 public abstract IActivePluginLogSerializer GetActivePluginLogSerializer(IPluginOrderLog p_polPluginOrderLog);
		/// <summary>
		/// A simple constructor that initializes the object with the given dependencies.
		/// </summary>
		/// <param name="p_gmdGameMode">The current game mode.</param>
		/// <param name="p_polPluginOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the current game mode.</param>
		/// <param name="p_bstLoadOrder">The LoadOrder instance to use to set plugin order.</param>
		public GamebryoActivePluginLogSerializer(IGameMode p_gmdGameMode, IPluginOrderLog p_polPluginOrderLog, ILoadOrderManager p_bstLoadOrder)
		{
			GameMode = p_gmdGameMode;
			PluginOrderLog = p_polPluginOrderLog;
			LoadOrderManager = p_bstLoadOrder;
		}
 /// <summary>
 /// A simple constructor that initializes the object with the given dependencies.
 /// </summary>
 /// <param name="p_gmdGameMode">The current game mode.</param>
 /// <param name="p_polPluginOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the current game mode.</param>
 /// <param name="p_bstLoadOrder">The LoadOrder instance to use to set plugin order.</param>
 public GamebryoActivePluginLogSerializer(IGameMode p_gmdGameMode, IPluginOrderLog p_polPluginOrderLog, ILoadOrderManager p_bstLoadOrder)
 {
     GameMode         = p_gmdGameMode;
     PluginOrderLog   = p_polPluginOrderLog;
     LoadOrderManager = p_bstLoadOrder;
 }
		/// <summary>
		/// A simpell constructor that initializes the object with the given services.
		/// </summary>
		/// <param name="p_ilgModInstallLog">The install log that tracks mod install info for the current game mode.</param>
		/// <param name="p_aplActivePluginLog">The <see cref="ActivePluginLog"/> tracking plugin activations for the current game mode.</param>
		/// <param name="p_polPluginOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the current game mode.</param>
		/// <param name="p_mrpModRepository">The repository we are logging in to.</param>
		/// <param name="p_mmgModManager">The mod manager to use to manage mods.</param>
		/// <param name="p_pmgPluginManager">The manager to use to manage plugins.</param>
		/// <param name="p_amtMonitor">The download monitor to use to manage the monitored activities.</param>
		/// <param name="p_umgUpdateManager">The update manager to use to perform updates.</param>
        public ServiceManager(IInstallLog p_ilgModInstallLog, ActivePluginLog p_aplActivePluginLog, IPluginOrderLog p_polPluginOrderLog, IModRepository p_mrpModRepository, ModManager p_mmgModManager, IPluginManager p_pmgPluginManager, DownloadMonitor p_amtMonitor, ActivateModsMonitor p_ammMonitor, UpdateManager p_umgUpdateManager)
		{
			ModInstallLog = p_ilgModInstallLog;
			ActivePluginLog = p_aplActivePluginLog;
			PluginOrderLog = p_polPluginOrderLog;
			ModRepository = p_mrpModRepository;
			ModManager = p_mmgModManager;
			PluginManager = p_pmgPluginManager;
			DownloadMonitor = p_amtMonitor;
			UpdateManager = p_umgUpdateManager;
            ActivateModsMonitor = p_ammMonitor;
		}
 /// <summary>
 /// A simple constructor that initializes the object with the given dependencies.
 /// </summary>
 /// <param name="p_gmdGameMode">The current game mode.</param>
 /// <param name="p_polPluginOrderLog">The <see cref="IPluginOrderLog"/> tracking plugin order for the current game mode.</param>
 /// <param name="p_bstBoss">The BOSS instance to use to set plugin order.</param>
 public GamebryoActivePluginLogSerializer(IGameMode p_gmdGameMode, IPluginOrderLog p_polPluginOrderLog, BossSorter p_bstBoss)
 {
     GameMode       = p_gmdGameMode;
     PluginOrderLog = p_polPluginOrderLog;
     BossSorter     = p_bstBoss;
 }