diff --git a/OSMDatastructure/OsmNode.cs b/OSMDatastructure/OsmNode.cs index 73b1a94..e808014 100644 --- a/OSMDatastructure/OsmNode.cs +++ b/OSMDatastructure/OsmNode.cs @@ -28,4 +28,22 @@ public class OsmNode return e; return null; } + + public override bool Equals(object? obj) + { + return obj != null && obj.GetType() == this.GetType() && ((OsmNode)obj).coordinates.Equals(this.coordinates); + } + + public override int GetHashCode() + { + return HashCode.Combine(coordinates); + } + + public override string ToString() + { + return string.Format( + "NODE {0} Edges-Count: {1} previousPathNode: {2} currentPathWeight: {3} directDistanceToGoal: {4}", + this.coordinates.ToString(), this.edges.Count, this.previousPathNode.coordinates.ToString(), + this.currentPathWeight, this.directDistanceToGoal); + } } \ No newline at end of file