Schematic drawing with live function, bench control by mouse, Dijkstra algo, vacuum, etc.

This commit is contained in:
Milan Hanajik
2020-06-14 13:01:53 +02:00
parent 2945049288
commit 1f67899a5c
223 changed files with 5684 additions and 3772 deletions
+39
View File
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
namespace SchematicDrawing
{
public class GNode
{
public IDrawingItem Item;
public int NodeId;
public readonly IList<GEdge> Edges;
public int Dist;
public bool Visited;
public GNode(IDrawingItem item, int nodeId)
{
this.Item = item;
this.NodeId = nodeId;
this.Edges = new List<GEdge>();
Reset();
}
public void AddEdge(GEdge edge)
{
Edges.Add(edge);
}
public void Reset()
{
Visited = false;
Dist = int.MaxValue;
}
public override string ToString()
{
return string.Format("{0}/{1} {2} dist={3}", Item.Name, NodeId, Visited ? "V" : "", Dist);
}
}
}