OsmNode.cs:
Fixed ToString() no previous node
This commit is contained in:
parent
e57912c589
commit
d18e4f5abf
@ -41,9 +41,15 @@ public class OsmNode
|
||||
|
||||
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);
|
||||
if(this.previousPathNode != null)
|
||||
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);
|
||||
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);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user