示例#1
0
        //step back
        protected override void NotifyBack(IColorable from, SerialSignal signal)
        {
            if (!(from is OutPoint) && from != this)
            {
                //
                return;
            }
            lock (this)
            {
                if (Output.IsFiltered(from))
                {
                    return;
                }
            }
            //Signal == true;
            signal.StopSending();

            Output.Filter(from);
            //if signal==true - we have to signal, otherwise we just need to find other output;
            if (from == CurrentPath)
            {
                FlowResult();
            }
            if (!SignalIfCan())
            {
                return;
            }
            Signal = signal;
            Output.Filter(from);

            base.NotifyBack(this, signal);
            InvokeOnNotifyBack();
            Input.NotifyBack(this, signal);
        }
示例#2
0
        /* public override IEnumerable<KeyValuePair<GraphNode, int>> GetNextNodes()
         * {
         *
         *  var connections = GetAllConnections();
         *  return connections.Select(connection =>
         *      {
         *          if (connection == null || connection.To == null || connection.To.Parent == null)
         *              return new KeyValuePair<GraphNode, int>(null,0);
         *          return new KeyValuePair<GraphNode, int>(connection.To.Parent,connection.Length);
         *      }).Where(graphNode => graphNode.Key != null);
         *
         * }*/



        // private readonly List<IColorable> _zeroSignalConnections = new List<IColorable>();


        protected override void NotifyBack(IColorable from, SerialSignal signal)
        {
            signal.StopSending();
            Connections.Filter(from);
        }