/// <summary>
 /// Create object from SolvroCityLink and init graph nodes
 /// </summary>
 /// <param name="solvroCityLink">Link to generate this object from</param>
 /// <param name="sourceNode">Source node</param>
 /// <param name="targetNode">Target node</param>
 /// <param name="reverse">Should data be reversed (sorurce as target, target as source)</param>
 /// <param name="available">Should be this link available in path finding algorithm</param>
 public SolvroCityGraphLink(SolvroCityLink solvroCityLink, SolvroCityGraphNode sourceNode, SolvroCityGraphNode targetNode, bool reverse = false, bool available = true) : base(solvroCityLink, reverse)
 {
     Available = available;
     if (reverse)
     {
         SourceNode = targetNode;
         TargetNode = sourceNode;
     }
     else
     {
         SourceNode = sourceNode;
         TargetNode = targetNode;
     }
 }
Esempio n. 2
0
 /// <summary>
 /// Generate link from already existing link
 /// </summary>
 /// <param name="solvroCityLink">Link from where should data be copied</param>
 /// <param name="reverse">Should data be reversed (source as target, target as source)</param>
 public SolvroCityLink(SolvroCityLink solvroCityLink, bool reverse = false)
 {
     if (!reverse)
     {
         source   = solvroCityLink.source;
         target   = solvroCityLink.target;
         distance = solvroCityLink.distance;
     }
     else
     {
         source   = solvroCityLink.target;
         target   = solvroCityLink.source;
         distance = solvroCityLink.distance;
     }
 }
 /// <summary>
 /// Create object from SolvroCityLink
 /// </summary>
 /// <param name="solvroCityLink">Link to generate this object from</param>
 /// <param name="reverse">Should data be reversed (sorurce as target, target as source)</param>
 /// <param name="available">Should be this link available in path finding algorithm</param>
 public SolvroCityGraphLink(SolvroCityLink solvroCityLink, bool reverse = false, bool available = true) : base(solvroCityLink, reverse)
 {
     Available  = available;
     SourceNode = null;
     TargetNode = null;
 }