Ejemplo n.º 1
0
    public override void Receive(ThoughtRequest thoughtRequest)
    {
        Topic.Stage requestStage = thoughtRequest.MyStage;
        string      topic        = thoughtRequest.Topic;

        if (!thoughts.ContainsKey(topic))
        {
            return;
        }
        if (!thoughts[topic].ContainsKey(requestStage))
        {
            return;
        }
        if (thoughts[topic][requestStage].Count <= 0)
        {
            return;
        }

        ThoughtResponse thoughtResponse = new ThoughtResponse(new HashSet <Thought>(thoughts[topic][requestStage]));

        thoughts[topic][requestStage].Clear();
        Send(thoughtResponse);
    }
Ejemplo n.º 2
0
 public abstract void Receive(ThoughtRequest thoughtRequest);
Ejemplo n.º 3
0
 public void Route(ThoughtRequest thoughtRequest) => thoughts.Receive(thoughtRequest);
Ejemplo n.º 4
0
 public void Send(ThoughtRequest thoughtRequest)
 {
     myInput.Route(thoughtRequest);
 }