OsmNode.cs:

Fixed ToString() no previous node
This commit is contained in:
C9Glax 2023-02-08 18:49:47 +01:00
parent e57912c589
commit d18e4f5abf

View File

@ -41,9 +41,15 @@ public class OsmNode
public override string ToString() public override string ToString()
{ {
return string.Format( if(this.previousPathNode != null)
"NODE {0} Edges-Count: {1} previousPathNode: {2} currentPathWeight: {3} directDistanceToGoal: {4}", return string.Format(
this.coordinates.ToString(), this.edges.Count, this.previousPathNode.coordinates.ToString(), "NODE {0} Edges-Count: {1} previousPathNode: {2} currentPathWeight: {3} directDistanceToGoal: {4}",
this.currentPathWeight, this.directDistanceToGoal); this.coordinates.ToString(), this.edges.Count, this.previousPathNode.coordinates.ToString(),
this.currentPathWeight, this.directDistanceToGoal);
else
return string.Format(
"NODE {0} Edges-Count: {1} previousPathNode: NO PREVIOUS NODE currentPathWeight: {2} directDistanceToGoal: {3}",
this.coordinates.ToString(), this.edges.Count,
this.currentPathWeight, this.directDistanceToGoal);
} }
} }