Schematic drawing with live function, bench control by mouse, Dijkstra algo, vacuum, etc.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user