Example #1
0
        public override void Handle(IntentsDataFlowData obj)
        {
            IntentChangeCollection intentChanges = null;

            IIntent[] newState = obj.Value.Select(x => x.Intent).ToArray();

            if (_OutputHasStateToCompare)
            {
                if (_OutputStateDiffersFrom(newState))
                {
                    IEnumerable <IIntent> addedIntents   = newState.Except(OutputCurrentState);
                    IEnumerable <IIntent> removedIntents = OutputCurrentState.Except(newState);
                    intentChanges = new IntentChangeCollection(addedIntents, removedIntents);
                }
            }
            else
            {
                intentChanges = new IntentChangeCollection(newState, null);
            }

            OutputCurrentState = newState.ToArray();
            Result             = intentChanges;
        }
Example #2
0
 private void _UpdateModuleState(IntentChangeCollection[] outputStates)
 {
     _SmartControllerModule.UpdateState(outputStates);
 }