コード例 #1
0
        public Optional <T> ReadInputValueFromCache(ForwardGate gate)
        {
            if (_cachedInputValueByGate.TryGetValue(gate, out T value))
            {
                _cachedInputValueByGate.Remove(gate);
                return(Optional <T> .FromValue(value));
            }

            return(Optional <T> .Empty);
        }
コード例 #2
0
 public void WriteInputValueToCache(ForwardGate gate, T value)
 {
     try
     {
         _firstInputValueByGate.Add(gate, value);
     }
     catch (ArgumentException exception)
     {
         throw new InvalidOperationException("Another input value is already present.", exception);
     }
 }
コード例 #3
0
 public void AddSuccessor(ForwardGate sucessor)
 {
     _successors.Add(sucessor);
 }
コード例 #4
0
 public GateEvaluation(ForwardGate gate, GateEvaluationInput <T> input)
 {
     _gate  = gate;
     _input = input;
 }