override Equals with check if lat and lon are equal
This commit is contained in:
parent
3350d8e3b9
commit
e3dabf8cb7
@ -46,5 +46,17 @@ namespace OSMDatastructure
|
||||
{
|
||||
return string.Format("{0} {1}", this.lat.ToString(CultureInfo.InvariantCulture), this.lon.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
if (obj != null && obj.GetType() == this.GetType())
|
||||
{
|
||||
Coordinates objconv = (Coordinates)obj;
|
||||
if (objconv.lat.Equals(this.lat) && objconv.lon.Equals(this.lon))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user