Пример #1
0
 private void InitializeLinks()
 {
     _links     = new Dictionary <int, Link>();
     LinksCount = EpanetNative.GetCount(CountType.EN_LINKCOUNT);
     for (int index = 1; index <= LinksCount; index++)
     {
         var nodes = EpanetNative.GetLinkNodes(index);
         var link  = new Link {
             Index = index,
             Id    = EpanetNative.GetLinkId(index),
             Node1 = GetNodeByIndex(nodes.Node1Index),
             Node2 = GetNodeByIndex(nodes.Node2Index)
         };
         _links.Add(index, link);
     }
 }
Пример #2
0
 private void InitializeNodes()
 {
     _nodes     = new Dictionary <int, Node>();
     NodesCount = EpanetNative.GetCount(CountType.EN_NODECOUNT);
     for (int index = 1; index <= NodesCount; index++)
     {
         var coord = EpanetNative.GetCoord(index);
         var node  = new Node {
             Index = index,
             Id    = EpanetNative.GetNodeId(index),
             X     = coord.X,
             Y     = coord.Y
         };
         _nodes.Add(index, node);
     }
 }