コード例 #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
ファイル: Geometry.cs プロジェクト: hartontw/UnityExtended
        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
ファイル: Model.cs プロジェクト: nuscien/trivial
 /// <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
ファイル: Model.cs プロジェクト: nuscien/trivial
 /// <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));
        }