Пример #1
0
 /// <summary>
 /// Indicates whether the current object is equal to another object of the same type.
 /// </summary>
 /// <returns>
 /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
 /// </returns>
 /// <param name="other">An object to compare with this object.</param>
 public override bool Equals(object other)
 {
     if (other is null)
     {
         return(false);
     }
     if (other is IAngle a)
     {
         return(Degrees.Equals(a.Degrees));
     }
     if (other is double d)
     {
         return(Degrees.Equals(d));
     }
     return(Degrees.Equals(other));
 }
Пример #2
0
        public override bool Equals(object other)
        {
            if (other == null)
            {
                return(false);
            }
            if (other == (object)this)
            {
                return(true);
            }
            if (!(other is Angle))
            {
                return(false);
            }

            Angle angle = (Angle)other;

            return(Degrees.Equals(angle.Degrees));
        }
Пример #3
0
        public bool Equals(float value, AngleType angleType)
        {
            switch (angleType)
            {
            case AngleType.Degree:
                return(Degrees.Equals(value));

            case AngleType.Gradian:
                return(Gradians.Equals(value));

            case AngleType.Radian:
                return(Radians.Equals(value));

            case AngleType.Turn:
                return(Turn.Equals(value));

            default:
                return(false);
            }
        }
Пример #4
0
 /// <summary>
 /// Indicates whether the current object is equal to another object of the same type.
 /// </summary>
 /// <returns>
 /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
 /// </returns>
 /// <param name="other">An object to compare with this object.</param>
 public bool Equals(int other)
 {
     return(Degrees.Equals(other));
 }
Пример #5
0
 /// <summary>
 /// Indicates whether the current object is equal to another object of the same type.
 /// </summary>
 /// <returns>
 /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
 /// </returns>
 /// <param name="other">An object to compare with this object.</param>
 public bool Equals(double other)
 {
     return(Degrees.Equals(other));
 }
Пример #6
0
 public bool Equals(Angle angle)
 {
     return(Degrees.Equals(angle.Degrees));
 }
Пример #7
0
 /// <summary>
 /// Indicates whether the current object is equal to another object of the same type.
 /// </summary>
 /// <returns>
 /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
 /// </returns>
 /// <param name="other">An object to compare with this object.</param>
 public virtual bool Equals(int other)
 => Degrees.Equals(other);
Пример #8
0
 /// <summary>
 /// Indicates whether the current object is equal to another object of the same type.
 /// </summary>
 /// <returns>
 /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
 /// </returns>
 /// <param name="other">An object to compare with this object.</param>
 public virtual bool Equals(double other)
 => Degrees.Equals(other);
Пример #9
0
        public override bool Equals(object obj)
        {
            var other = obj as Angle;

            return(other != null && Degrees.Equals(other.Degrees));
        }