Пример #1
0
 /// <summary>
 ///     Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked            // Overflow is fine, just wrap
     {
         int hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (Nagr != null)
         {
             hashCode = hashCode * 59 + Nagr.GetHashCode();
         }
         if (Tagr != null)
         {
             hashCode = hashCode * 59 + Tagr.GetHashCode();
         }
         if (Npgr != null)
         {
             hashCode = hashCode * 59 + Npgr.GetHashCode();
         }
         if (Bepsgr != null)
         {
             hashCode = hashCode * 59 + Bepsgr.GetHashCode();
         }
         if (Npasgr != null)
         {
             hashCode = hashCode * 59 + Npasgr.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #2
0
        /// <summary>
        ///     Returns true if GrowthAbility instances are equal
        /// </summary>
        /// <param name="other">Instance of GrowthAbility to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(GrowthAbility other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Nagr == other.Nagr ||
                     Nagr != null &&
                     Nagr.Equals(other.Nagr)
                     ) &&
                 (
                     Tagr == other.Tagr ||
                     Tagr != null &&
                     Tagr.Equals(other.Tagr)
                 ) &&
                 (
                     Npgr == other.Npgr ||
                     Npgr != null &&
                     Npgr.Equals(other.Npgr)
                 ) &&
                 (
                     Bepsgr == other.Bepsgr ||
                     Bepsgr != null &&
                     Bepsgr.Equals(other.Bepsgr)
                 ) &&
                 (
                     Npasgr == other.Npasgr ||
                     Npasgr != null &&
                     Npasgr.Equals(other.Npasgr)
                 ));
        }