/// <summary>
        /// A simple constructor that initializes the object with the given dependencies.
        /// </summary>
        /// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param>
        /// <param name="p_gmdGameMode">The game mode for which plugins are being managed.</param>
        /// <param name="p_futFileUtility">The file utility class.</param>
        /// <param name="p_strMasterlistPath">The path to the masterlist file to use.</param>
        public BossSorter(IEnvironmentInfo p_eifEnvironmentInfo, MorrowindGameMode p_gmdGameMode, FileUtil p_futFileUtility, string p_strMasterlistPath)
        {
            EnvironmentInfo = p_eifEnvironmentInfo;
            GameMode        = p_gmdGameMode;
            FileUtility     = p_futFileUtility;

            string strBAPIPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "data"), p_eifEnvironmentInfo.Is64BitProcess ? "boss64.dll" : "boss32.dll");

            m_ptrBossApi = LoadLibrary(strBAPIPath);
            if (m_ptrBossApi == IntPtr.Zero)
            {
                throw new BossException(String.Format("Could not load BAPI library: {0}", strBAPIPath));
            }

            LoadMethods();

            m_ptrBossDb = CreateBossDb();

            MasterlistPath = p_strMasterlistPath;
            UserlistPath   = null;

            if (!String.IsNullOrEmpty(MasterlistPath) && File.Exists(MasterlistPath) ||
                !String.IsNullOrEmpty(UserlistPath) && File.Exists(UserlistPath))
            {
                Load(MasterlistPath, UserlistPath);
            }
        }
Exemplo n.º 2
0
		/// <summary>
		/// A simple constructor that initializes the object with the given dependencies.
		/// </summary>
		/// <param name="p_eifEnvironmentInfo">The application's envrionment info.</param>
		/// <param name="p_gmdGameMode">The game mode for which plugins are being managed.</param>
		/// <param name="p_futFileUtility">The file utility class.</param>
		/// <param name="p_strMasterlistPath">The path to the masterlist file to use.</param>
		public BossSorter(IEnvironmentInfo p_eifEnvironmentInfo, MorrowindGameMode p_gmdGameMode, FileUtil p_futFileUtility, string p_strMasterlistPath)
		{
			EnvironmentInfo = p_eifEnvironmentInfo;
			GameMode = p_gmdGameMode;
			FileUtility = p_futFileUtility;

			string strBAPIPath = Path.Combine(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "data"), p_eifEnvironmentInfo.Is64BitProcess ? "boss64.dll" : "boss32.dll");

			m_ptrBossApi = LoadLibrary(strBAPIPath);
			if (m_ptrBossApi == IntPtr.Zero)
				throw new BossException(String.Format("Could not load BAPI library: {0}", strBAPIPath));

			LoadMethods();

			m_ptrBossDb = CreateBossDb();

			MasterlistPath = p_strMasterlistPath;
			UserlistPath = null;

			if (!String.IsNullOrEmpty(MasterlistPath) && File.Exists(MasterlistPath) ||
				!String.IsNullOrEmpty(UserlistPath) && File.Exists(UserlistPath))
				Load(MasterlistPath, UserlistPath);
		}