Exemple #1
0
        public bool Equals(Requisition other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(string.Equals(CategoryName, other.CategoryName) &&
                   CertificationRequisitionId.Equals(other.CertificationRequisitionId) &&
                   ContentId.Equals(other.ContentId) &&
                   string.Equals(Description, other.Description) &&
                   Id.Equals(other.Id) &&
                   string.Equals(InternalCategoryName, other.InternalCategoryName) &&
                   string.Equals(InternalSubcategoryName, other.InternalSubcategoryName) &&
                   IsCertification == other.IsCertification &&
                   IsMythic == other.IsMythic &&
                   IsWearable == other.IsWearable &&
                   HideIfNotAcquired == other.HideIfNotAcquired &&
                   string.Equals(LargeImageUrl, other.LargeImageUrl) &&
                   LevelRequirement == other.LevelRequirement &&
                   string.Equals(Name, other.Name) &&
                   string.Equals(Rarity, other.Rarity) &&
                   RarityType == other.RarityType &&
                   SellPrice == other.SellPrice &&
                   string.Equals(SubcategoryName, other.SubcategoryName) &&
                   SubcategoryOrder == other.SubcategoryOrder &&
                   SupportedGameModes.OrderBy(sgm => sgm).SequenceEqual(other.SupportedGameModes.OrderBy(sgm => sgm)) &&
                   UseType == other.UseType);
        }
Exemple #2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = CategoryName?.GetHashCode() ?? 0;
         hashCode = (hashCode * 397) ^ CertificationRequisitionId.GetHashCode();
         hashCode = (hashCode * 397) ^ ContentId.GetHashCode();
         hashCode = (hashCode * 397) ^ (Description?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ Id.GetHashCode();
         hashCode = (hashCode * 397) ^ (InternalCategoryName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (InternalSubcategoryName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ IsCertification.GetHashCode();
         hashCode = (hashCode * 397) ^ IsMythic.GetHashCode();
         hashCode = (hashCode * 397) ^ IsWearable.GetHashCode();
         hashCode = (hashCode * 397) ^ HideIfNotAcquired.GetHashCode();
         hashCode = (hashCode * 397) ^ (LargeImageUrl?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ LevelRequirement;
         hashCode = (hashCode * 397) ^ (Name?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (Rarity?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (int)RarityType;
         hashCode = (hashCode * 397) ^ SellPrice;
         hashCode = (hashCode * 397) ^ (SubcategoryName?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ SubcategoryOrder;
         hashCode = (hashCode * 397) ^ (SupportedGameModes?.GetHashCode() ?? 0);
         hashCode = (hashCode * 397) ^ (int)UseType;
         return(hashCode);
     }
 }
        /// <summary>
        /// Selectes the current game mode.
        /// </summary>
        /// <param name="p_strRequestedGameMode">The id of the game mode we want to select.</param>
        /// <param name="p_booChangeDefaultGameMode">Whether the users ahs requested a change to the default game mode.</param>
        /// <returns>The <see cref="IGameModeFactory"/> that can build the game mode selected by the user.</returns>
        public IGameModeFactory SelectGameMode(string p_strRequestedGameMode, bool p_booChangeDefaultGameMode)
        {
            Trace.Write("Determining Game Mode: ");

            string strSelectedGame = EnvironmentInfo.Settings.RememberGameMode ? EnvironmentInfo.Settings.RememberedGameMode : null;

            if (!String.IsNullOrEmpty(p_strRequestedGameMode))
            {
                Trace.Write("(Requested Mode: " + p_strRequestedGameMode + ") ");
                strSelectedGame = p_strRequestedGameMode;
            }

            if (p_booChangeDefaultGameMode || String.IsNullOrEmpty(strSelectedGame))
            {
                Trace.Write("(From Selection Form) ");
                List <IGameModeDescriptor> lstGameModeInfos = new List <IGameModeDescriptor>();
                foreach (IGameModeDescriptor gmdGameMode in InstalledGameModes.RegisteredGameModes)
                {
                    lstGameModeInfos.Add(gmdGameMode);
                }
                GameModeSelectionForm msfSelector = new GameModeSelectionForm(lstGameModeInfos, EnvironmentInfo.Settings);
                msfSelector.ShowDialog();
                if ((msfSelector.DialogResult == DialogResult.OK) && !(RescanRequested = msfSelector.RescanRequested))
                {
                    strSelectedGame = msfSelector.SelectedGameModeId;
                }
                else
                {
                    return(null);
                }
            }
            Trace.WriteLine(strSelectedGame);
            if (!InstalledGameModes.IsRegistered(strSelectedGame))
            {
                StringBuilder stbError = new StringBuilder();
                if (!SupportedGameModes.IsRegistered(strSelectedGame))
                {
                    stbError.AppendFormat("Unrecognized Game Mode: {0}", strSelectedGame);
                }
                else
                {
                    stbError.AppendFormat("{0} is not set up to work with {1}", EnvironmentInfo.Settings.ModManagerName, SupportedGameModes.GetGameMode(strSelectedGame).GameModeDescriptor.Name).AppendLine();
                    stbError.AppendFormat("If {0} is installed, rescan for installed games from the Change Game toolbar item.", SupportedGameModes.GetGameMode(strSelectedGame).GameModeDescriptor.Name).AppendLine();
                }
                Trace.TraceError(stbError.ToString());
                MessageBox.Show(stbError.ToString(), "Unrecognized Game Mode", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return(null);
            }

            return(InstalledGameModes.GetGameMode(strSelectedGame));
        }