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); }
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); } }
public void AddSuccessor(ForwardGate sucessor) { _successors.Add(sucessor); }
public GateEvaluation(ForwardGate gate, GateEvaluationInput <T> input) { _gate = gate; _input = input; }