コード例 #1
0
 public override int GetHashCode()
 {
     unchecked {
         int hashCode = (Category != null ? Category.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SubCategory != null ? SubCategory.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SubSubCatergory != null ? SubSubCatergory.GetHashCode() : 0);
         return(hashCode);
     }
 }
コード例 #2
0
        public override int GetHashCode()
        {
            var hash = Name == null ? 0 : Name.GetHashCode();

            hash += Acquired.GetHashCode();
            hash += Category.GetHashCode();
            hash += SubCategory == null ? 0 : SubCategory.GetHashCode();
            hash += InUse.GetHashCode();
            hash += Owner == null ? 0 : Owner.GetHashCode();
            hash += PartOf == null ? 0 : PartOf.GetHashCode();
            return(hash);
        }
コード例 #3
0
ファイル: EmblemItem.cs プロジェクト: PMArkive/ReMasters
        public override int GetHashCode()
        {
            int hash = 1;

            if (ItemId != 0L)
            {
                hash ^= ItemId.GetHashCode();
            }
            if (SubCategory != 0L)
            {
                hash ^= SubCategory.GetHashCode();
            }
            if (U3 != 0)
            {
                hash ^= U3.GetHashCode();
            }
            if (Rarity != 0)
            {
                hash ^= Rarity.GetHashCode();
            }
            if (U5 != 0)
            {
                hash ^= U5.GetHashCode();
            }
            if (ImageId.Length != 0)
            {
                hash ^= ImageId.GetHashCode();
            }
            if (ScheduleId.Length != 0)
            {
                hash ^= ScheduleId.GetHashCode();
            }
            if (U8 != 0)
            {
                hash ^= U8.GetHashCode();
            }
            if (U9 != 0L)
            {
                hash ^= U9.GetHashCode();
            }
            if (_unknownFields != null)
            {
                hash ^= _unknownFields.GetHashCode();
            }
            return(hash);
        }
コード例 #4
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (ProductId != null)
         {
             hashCode = hashCode * 59 + ProductId.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (ProductNumber != null)
         {
             hashCode = hashCode * 59 + ProductNumber.GetHashCode();
         }
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (StandardCost != null)
         {
             hashCode = hashCode * 59 + StandardCost.GetHashCode();
         }
         if (ListPrice != null)
         {
             hashCode = hashCode * 59 + ListPrice.GetHashCode();
         }
         if (Size != null)
         {
             hashCode = hashCode * 59 + Size.GetHashCode();
         }
         if (Weight != null)
         {
             hashCode = hashCode * 59 + Weight.GetHashCode();
         }
         if (ProductLine != null)
         {
             hashCode = hashCode * 59 + ProductLine.GetHashCode();
         }
         if (Class != null)
         {
             hashCode = hashCode * 59 + Class.GetHashCode();
         }
         if (Style != null)
         {
             hashCode = hashCode * 59 + Style.GetHashCode();
         }
         if (SubCategory != null)
         {
             hashCode = hashCode * 59 + SubCategory.GetHashCode();
         }
         if (Model != null)
         {
             hashCode = hashCode * 59 + Model.GetHashCode();
         }
         if (Photo != null)
         {
             hashCode = hashCode * 59 + Photo.GetHashCode();
         }
         if (Review != null)
         {
             hashCode = hashCode * 59 + Review.GetHashCode();
         }
         return(hashCode);
     }
 }