Пример #1
0
 public ConnectionEndpoint(CircuitEdge edge)
 {
     if (edge != null)
     {
         this.Component = edge.OutNode.Component;
         this.OutputId  = edge.OutId;
     }
 }
Пример #2
0
    public void AddEdge(LogicComponent out_component, int out_id,
                        LogicComponent in_component, int in_id)
    {
        var out_node = Nodes[out_component];
        var in_node  = Nodes[in_component];
        var edge     = new CircuitEdge(out_node, out_id, in_node, in_id);

        out_node.AddEdgeOut(edge);
        in_node.AddEdgeIn(edge);
    }
Пример #3
0
 private void RemoveCircuitEdge(CircuitEdge edge)
 {
     if (edge == null)
     {
         return;
     }
     if (!edge.OutNode.HasEdgeOut(edge) || !edge.InNode.HasEdgeIn(edge))
     {
         throw new ArgumentException("Given edge does not exist");
     }
     edge.OutNode.RemoveEdgeOut(edge.OutId);
     edge.InNode.RemoveEdgeIn(edge.InId);
 }
        private void OnCircuitEdge(TEdge edge)
        {
            Debug.Assert(edge != null);

            CircuitEdge?.Invoke(edge);
        }
 public bool HasEdgeIn(CircuitEdge edge)
 {
     return(this.AdjListIn[edge.InId] == edge);
 }
 public void AddEdgeIn(CircuitEdge edge)
 {
     this.AdjListIn[edge.InId] = edge;
 }
 public bool HasEdgeOut(CircuitEdge edge)
 {
     return(this.AdjListOut[edge.OutId] == edge);
 }
 public void AddEdgeOut(CircuitEdge edge)
 {
     this.AdjListOut[edge.OutId] = edge;
 }