Exemplo n.º 1
0
        public SignalDeclarationAsyncInitializer(
            [Inject(Source = InjectSources.Local)]
            List <SignalDeclaration> signalDeclarations,
            [Inject(Optional = true, Source = InjectSources.Local)]
            TickableManager tickManager)
        {
            for (int i = 0; i < signalDeclarations.Count; i++)
            {
                var declaration = signalDeclarations[i];

                if (declaration.IsAsync)
                {
                    Assert.IsNotNull(tickManager, "TickableManager is required when using asynchronous signals");
                    tickManager.Add(declaration, declaration.TickPriority);
                }
            }
        }
        public SignalCommandCallbackWrapper(
            SignalBindingBindInfo bindInfo,
            Pool <TCommand, TSignal> commandPool,
            SignalBus signalBus,
            TickableManager tickableManager)
        {
            if (bindInfo == null)
            {
                return;
            }

            _signalType      = bindInfo.SignalType;
            _identifier      = bindInfo.Identifier;
            _signalBus       = signalBus;
            _tickableManager = tickableManager;
            _commandPool     = commandPool;

            signalBus.SubscribeId(bindInfo.SignalType, _identifier, OnSignalFired);
        }
Exemplo n.º 3
0
 public TickableManager(
     [InjectOptional(Source = InjectSources.Parent)]
     TickableManager parent)
 {
     _parent = parent;
 }