Exemplo 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 (Presence != null)
         {
             hashCode = hashCode * 59 + Presence.GetHashCode();
         }
         if (Format != null)
         {
             hashCode = hashCode * 59 + Format.GetHashCode();
         }
         if (Label != null)
         {
             hashCode = hashCode * 59 + Label.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 2
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id.GetHashCode();
         hashCode = (hashCode * 397) ^ (AvatarId != null ? AvatarId.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Mention != null ? Mention.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Username != null ? Username.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Discriminator != null ? Discriminator.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CreatedAt.GetHashCode();
         hashCode = (hashCode * 397) ^ IsBot.GetHashCode();
         hashCode = (hashCode * 397) ^ (Presence != null ? Presence.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (DirectMessageChannel != null ? DirectMessageChannel.GetHashCode() : 0);
         return(hashCode);
     }
 }