public void ProcessInputData(IntentsDataFlowData data) { //Because we are combining at the layer above us, we should really only have one //intent that matches this outputs color setting. //Everything else will have a zero intensity and should be thrown away when it does not match our outputs color. double intensity = 0; if (data.Value?.Count > 0) { foreach (var intentState in data.Value) { var i = _filter.GetIntensityForState(intentState); if (i > 0) { intensity = i; } } } if (intensity > 0) { //Get a ref to the state value which is a struct and update it with the new intensity ref IntensityValue intensityValue = ref _state.GetValueRef(); intensityValue.Intensity = intensity; _data.Value = _state; }