Esempio n. 1
0
        protected override void UpdateCommands(List <ILifeTimeCommand> nodeCommands)
        {
            base.UpdateCommands(nodeCommands);

            var context       = Context;
            var port          = UniTask.FromResult <IContext>(PortPair.OutputPort);
            var contextSource = UniTask.FromResult <IContext>(context);

            var bindContextToOutput = new MessageBroadcastCommand(context, PortPair.OutputPort);
            //register all Context Sources Data into target context asset
            var registerDataSourceIntoContext = new OwnerRegisterDataSourceCommand(contextSource, dataSources);
            //Register context to output port
            var contextToOutputPortCommand = new DataSourceTaskCommand <IContext>(contextSource, port);

            nodeCommands.Add(bindContextToOutput);
            nodeCommands.Add(registerDataSourceIntoContext);
            nodeCommands.Add(contextToOutputPortCommand);
        }
        protected override void UpdateCommands(List <ILifeTimeCommand> nodeCommands)
        {
            base.UpdateCommands(nodeCommands);

            _contextConnection ??= new ContextConnection().AddTo(LifeTime);

            var outPort       = UniTask.FromResult <IContext>(PortPair.OutputPort);
            var contextSource = UniTask.FromResult <IContext>(_contextConnection);

            var bindContextToOutput = new MessageBroadcastCommand(_contextConnection, PortPair.OutputPort);
            //register all Context Sources Data into target context asset
            var registerDataSourceIntoContext = new OwnerRegisterDataSourceCommand(contextSource, _dataSources);
            //Register context to output port
            var contextToOutputPortCommand  = new DataSourceTaskCommand <IContext>(contextSource, outPort);
            var contextContainerBindCommand = new ParentContextContainerBindCommand(_contextConnection, _parentContextContainer);

            nodeCommands.Add(bindContextToOutput);
            nodeCommands.Add(registerDataSourceIntoContext);
            nodeCommands.Add(contextToOutputPortCommand);
            nodeCommands.Add(contextContainerBindCommand);
        }