public CQRSService(
            IGamePlayEngine gamePlayEngine,
            IGamePlayListener gamePlayListener,
            IReadCacheDataRepository readCacheDataRepository,
            IGameDataRepository gameDataRepository,
            ICqrsLogicHandler logicHandler,
            IEventPublisher eventPublisher,
            IComponentContext componentContext,
            ILogFactory logFactory
            ) : base(componentContext, logFactory)
        {
            _gamePlayEngine          = gamePlayEngine;
            _gamePlayListener        = gamePlayListener;
            _readCacheDataRepository = readCacheDataRepository;
            _gameDataRepository      = gameDataRepository;

            _logicHandler = logicHandler;

            _handlers.AddRange(
                componentContext.ResolveAll <IHttpRequestHandler>()
                );

            _log = logFactory.CreateForType(this);

            // Subscribe myself to any event
            eventPublisher.Attach(this);
        }
        public AbstractService(
            IComponentContext componentContext,
            ILogFactory logFactory
            )
        {
            _logicHandler        = componentContext.Resolve <ICqrsLogicHandler>();
            _eventPublisher      = componentContext.Resolve <IEventPublisher>();
            _localTcpPortManager = componentContext.Resolve <ILocalTcpPortManager>();
            _appSettings         = componentContext.Resolve <IAppSettings>();

            _log = logFactory.CreateForType(this);
        }
Example #3
0
        public RESTFulService(
            IRESTFulGameEngineListener gameEngineListener,
            IGamePlayEngine gamePlayEngine,
            ICqrsLogicHandler logicHandler,
            IComponentContext componentContext,
            ILogFactory logFactory
            ) : base(componentContext, logFactory)
        {
            _gameEngineListener = gameEngineListener;
            _gamePlayEngine     = gamePlayEngine;

            _logicHandler = logicHandler;

            _log = logFactory.CreateForType(this);
        }
        public ConsoleService(
            IGamePlayEngine gamePlayEngine,
            IGamePlayListener gamePlayListener,
            IReadCacheDataRepository readCacheDataRepository,
            IGameDataRepository gameDataRepository,
            ICqrsLogicHandler logicHandler,
            IComponentContext componentContext,
            ILogFactory logFactory
            ) : base(componentContext, logFactory)
        {
            _gamePlayEngine          = gamePlayEngine;
            _gamePlayListener        = gamePlayListener;
            _readCacheDataRepository = readCacheDataRepository;
            _gameDataRepository      = gameDataRepository;

            _logicHandler = logicHandler;

            _log = logFactory.CreateForType(this);
        }