Esempio n. 1
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 (Agent != null)
         {
             hashCode = hashCode * 59 + Agent.GetHashCode();
         }
         if (Id != null)
         {
             hashCode = hashCode * 59 + Id.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (UserId != null)
         {
             hashCode = hashCode * 59 + UserId.GetHashCode();
         }
         if (CreatedAt != null)
         {
             hashCode = hashCode * 59 + CreatedAt.GetHashCode();
         }
         if (LegacyProfile != null)
         {
             hashCode = hashCode * 59 + LegacyProfile.GetHashCode();
         }
         if (Suspended != null)
         {
             hashCode = hashCode * 59 + Suspended.GetHashCode();
         }
         if (Paid != null)
         {
             hashCode = hashCode * 59 + Paid.GetHashCode();
         }
         if (Migrated != null)
         {
             hashCode = hashCode * 59 + Migrated.GetHashCode();
         }
         if (Legacy != null)
         {
             hashCode = hashCode * 59 + Legacy.GetHashCode();
         }
         return(hashCode);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Returns true if GameProfile instances are equal
        /// </summary>
        /// <param name="other">Instance of GameProfile to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(GameProfile other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Agent == other.Agent ||
                     Agent != null &&
                     Agent.Equals(other.Agent)
                     ) &&
                 (
                     Id == other.Id ||
                     Id != null &&
                     Id.Equals(other.Id)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     UserId == other.UserId ||
                     UserId != null &&
                     UserId.Equals(other.UserId)
                 ) &&
                 (
                     CreatedAt == other.CreatedAt ||
                     CreatedAt != null &&
                     CreatedAt.Equals(other.CreatedAt)
                 ) &&
                 (
                     LegacyProfile == other.LegacyProfile ||
                     LegacyProfile != null &&
                     LegacyProfile.Equals(other.LegacyProfile)
                 ) &&
                 (
                     Suspended == other.Suspended ||
                     Suspended != null &&
                     Suspended.Equals(other.Suspended)
                 ) &&
                 (
                     Paid == other.Paid ||
                     Paid != null &&
                     Paid.Equals(other.Paid)
                 ) &&
                 (
                     Migrated == other.Migrated ||
                     Migrated != null &&
                     Migrated.Equals(other.Migrated)
                 ) &&
                 (
                     Legacy == other.Legacy ||
                     Legacy != null &&
                     Legacy.Equals(other.Legacy)
                 ));
        }