Example #1
0
 /// <summary>
 /// A hash code produced out of hash codes of Radius and center.
 /// </summary>
 /// <returns>
 /// A hash code produced out of hash codes of Radius and center.
 /// </returns>
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Radius.GetHashCode();
         hashCode = (hashCode * 397) ^ CenterX.GetHashCode();
         hashCode = (hashCode * 397) ^ CenterY.GetHashCode();
         return(hashCode);
     }
 }
Example #2
0
        public override int GetHashCode() // переопределение метода GetHashCode()
        {
            var hash = 19;

            hash = hash * 37 + CenterX.GetHashCode();
            hash = hash * 37 + CenterY.GetHashCode();
            hash = hash * 37 + SizeArea.GetHashCode();
            hash = hash * 37 + FractalType.GetHashCode();

            return(hash);
        }
Example #3
0
        public override int GetHashCode()
        {
            unchecked // Overflow is fine
            {
                // http://stackoverflow.com/questions/263400/what-is-the-best-algorithm-for-an-overridden-system-object-gethashcode/263416#263416
                int hash = 17;
                hash = hash * 23 + CenterX.GetHashCode();
                hash = hash * 23 + CenterY.GetHashCode();
                hash = hash * 23 + Width.GetHashCode();
                hash = hash * 23 + Height.GetHashCode();
                hash = hash * 23 + Angle.GetHashCode();

                return(hash);
            }
        }
Example #4
0
 public override int GetHashCode()
 {
     return(CenterX.GetHashCode() ^ CenterY.GetHashCode());
 }