/// <summary>
			/// Gets the ordered list of mod that have installed the specified game specific value edit.
			/// </summary>
			/// <param name="p_strKey">The key of the game specific value edit for which to retrieve the list of installing mods.</param>
			/// <returns>The ordered list of mods that have installed the specified game specific value edit.</returns>
			protected InstallerStack<byte[]> GetCurrentGameSpecificValueInstallers(string p_strKey)
			{
				InstallerStack<byte[]> stkInstallers = new InstallerStack<byte[]>();
				if (EnlistedInstallLog.m_dicInstalledGameSpecificValueEdits.ContainsItem(p_strKey))
					stkInstallers.PushRange(EnlistedInstallLog.m_dicInstalledGameSpecificValueEdits[p_strKey]);
				if (m_dicInstalledGameSpecificValueEdits.ContainsItem(p_strKey))
					foreach (InstalledValue<byte[]> isvMod in m_dicInstalledGameSpecificValueEdits[p_strKey])
					{
						stkInstallers.Remove(isvMod);
						stkInstallers.Push(isvMod);
					}
				if (m_dicReplacedGameSpecificValueEdits.ContainsItem(p_strKey))
					foreach (InstalledValue<byte[]> isvMod in m_dicReplacedGameSpecificValueEdits[p_strKey])
						stkInstallers.Find(x => x.Equals(isvMod)).Value = isvMod.Value;
				if (m_dicUninstalledGameSpecificValueEdits.ContainsItem(p_strKey))
					foreach (InstalledValue<byte[]> isvMod in m_dicUninstalledGameSpecificValueEdits[p_strKey])
						stkInstallers.Remove(isvMod);
				m_setRemovedModKeys.ForEach(x => stkInstallers.Remove(x));
				return stkInstallers;
			}
			/// <summary>
			/// Gets the ordered list of mod that have installed the specified file.
			/// </summary>
			/// <param name="p_strPath">The path of the file for which to retrieve the list of installing mods.</param>
			/// <returns>The ordered list of mods that have installed the specified file.</returns>
			protected InstallerStack<object> GetCurrentFileInstallers(string p_strPath)
			{
				string strNormalizedPath = FileUtil.NormalizePath(p_strPath);
				InstallerStack<object> stkInstallers = new InstallerStack<object>();
				if (EnlistedInstallLog.m_dicInstalledFiles.ContainsItem(strNormalizedPath))
					stkInstallers.PushRange(EnlistedInstallLog.m_dicInstalledFiles[strNormalizedPath]);
				if (m_dicInstalledFiles.ContainsItem(strNormalizedPath))
					foreach (InstalledValue<object> isvMod in m_dicInstalledFiles[strNormalizedPath])
					{
						stkInstallers.Remove(isvMod);
						stkInstallers.Push(isvMod);
					}
				if (m_dicUninstalledFiles.ContainsItem(strNormalizedPath))
					foreach (InstalledValue<object> isvMod in m_dicUninstalledFiles[strNormalizedPath])
						stkInstallers.Remove(isvMod);
				m_setRemovedModKeys.ForEach(x => stkInstallers.Remove(x));
				return stkInstallers;
			}
			/// <summary>
			/// Gets the ordered list of mod that have installed the given ini edit.
			/// </summary>
			/// <param name="p_iedEdit">The ini edit for which to retrieve the list of installing mods.</param>
			/// <returns>The ordered list of mods that have installed the given ini edit.</returns>
			protected InstallerStack<string> GetCurrentIniEditInstallers(IniEdit p_iedEdit)
			{
				InstallerStack<string> stkInstallers = new InstallerStack<string>();
				if (EnlistedInstallLog.m_dicInstalledIniEdits.ContainsItem(p_iedEdit))
					stkInstallers.PushRange(EnlistedInstallLog.m_dicInstalledIniEdits[p_iedEdit]);
				if (m_dicInstalledIniEdits.ContainsItem(p_iedEdit))
					foreach (InstalledValue<string> isvMod in m_dicInstalledIniEdits[p_iedEdit])
					{
						stkInstallers.Remove(isvMod);
						stkInstallers.Push(isvMod);
					}
				if (m_dicReplacedIniEdits.ContainsItem(p_iedEdit))
					foreach (InstalledValue<string> isvMod in m_dicReplacedIniEdits[p_iedEdit])
						stkInstallers.Find(x => x.Equals(isvMod)).Value = isvMod.Value;
				if (m_dicUninstalledIniEdits.ContainsItem(p_iedEdit))
					foreach (InstalledValue<string> isvMod in m_dicUninstalledIniEdits[p_iedEdit])
						stkInstallers.Remove(isvMod);
				m_setRemovedModKeys.ForEach(x => stkInstallers.Remove(x));
				return stkInstallers;
			}
Ejemplo n.º 4
0
 /// <summary>
 /// A simple constructor that initializes the object with the given values.
 /// </summary>
 /// <param name="p_tItem">The installed item.</param>
 public ItemInstallers(T p_tItem)
 {
     Item       = p_tItem;
     Installers = new InstallerStack <K>();
 }