/// <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)); }
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)); }
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); } }
/// <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)); }
/// <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)); }
public bool Equals(Angle angle) { return(Degrees.Equals(angle.Degrees)); }
/// <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);
/// <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);
public override bool Equals(object obj) { var other = obj as Angle; return(other != null && Degrees.Equals(other.Degrees)); }