Пример #1
0
        public EventPublisher(
            IComponentContext componentContext,
            StartableThread startableThread,
            ILogFactory logFactory
            )
        {
            _componentContext = componentContext;
            _thread           = startableThread;

            _log = logFactory.CreateForType(this);

            _thread.Name          = "EventPublisher";
            _thread.ThreadLatency = TimeSpan.FromMilliseconds(150);
            _thread.ThreadLoop    = ProcessEventQueue;
        }
        public GamePlayEngine(
            IAcceleratedClock clock,
            StartableThread startableThread,
            IGameDataRepository gameDataRepository,
            IAppSettings appSettings,
            IRandom random,
            ILogFactory logFactory
            )
        {
            _clock              = clock;
            _startableThread    = startableThread;
            _gameDataRepository = gameDataRepository;
            _appSettings        = appSettings;
            _random             = random;

            _log = logFactory.CreateForType(this);

            // Define parameters for the background thread
            _startableThread.Name          = "GameEngine";
            _startableThread.ThreadLatency = TimeSpan.FromMilliseconds(250);
            _startableThread.ThreadLoop    = RunEngine;
        }