Graph: Enhance path finiding

This commit is contained in:
2026-07-14 12:31:42 +02:00
parent 6e49693db4
commit da257b3285
2 changed files with 11 additions and 7 deletions
+1
View File
@@ -3,6 +3,7 @@
INode Start,
IEnumerable<(IEdge Edge, INode Node)> Hops)
{
public readonly double Bends => Hops.Sum(h => h.Edge.Start.CenterX != h.Edge.End.CenterX && h.Edge.Start.CenterY != h.Edge.End.CenterY ? 1 : 0);
public readonly double Length => Hops.Sum(h => Math.Abs(h.Edge.Start.CenterX - h.Edge.End.CenterX) + Math.Abs(h.Edge.Start.CenterY - h.Edge.End.CenterY));
}
}