Added Override for Equals() GetHashCode() ToString()
This commit is contained in:
parent
31b2810178
commit
5f4e2bb5f0
@ -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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user