public override bool Equals(Shape other) { if (other is Point) { var pt = other as Point; if (XCoordinate.Equals(pt.XCoordinate) && YCoordinate.Equals(pt.YCoordinate)) { return(true); } if (!XCoordinate.Equals(pt.XCoordinate)) { return(false); } if (!YCoordinate.Equals(pt.YCoordinate)) { return(false); } } else { return(false); } return(base.Equals(other)); }
public bool Equals([AllowNull] Location other) { if (Object.ReferenceEquals(other, null)) { return(false); } if (Object.ReferenceEquals(this, other)) { return(true); } return(XCoordinate.Equals(other.XCoordinate) && YCoordinate.Equals(other.YCoordinate)); }
public override bool Equals(object obj) { return(obj is Point point && XCoordinate.Equals(point.XCoordinate) && YCoordinate.Equals(point.YCoordinate)); }