Ejemplo n.º 1
0
        private void ThreadAwake()
        {
            GameStatusUpdate gameStatusUpdate = _gameStatusRetriever.GetCurrentStatus();

            GameUpdated?.Invoke(gameStatusUpdate);

            ChangeDelay(gameStatusUpdate.GameStatus);
        }
Ejemplo n.º 2
0
        public GameStatusUpdate GetCurrentStatus()
        {
            if (!_gameWindowManager.IsWindowActive())
            {
                return(new GameStatusUpdate(GameStatus.Offline, null));
            }

            if (_gameWindowManager.IsWindowMinimised())
            {
                return(new GameStatusUpdate(GameStatus.Minimised, null));
            }

            IntPtr imagePointer = _gameWindowManager.CaptureWindow();
            IImage windowImage  = _toImageConverter.ImageFrom(imagePointer);

            GameStatusUpdate gameStatusUpdate = _gameImageProcessor.ProcessGameImage(windowImage);

            _gameWindowManager.ReleaseWindowCapture(imagePointer);

            return(gameStatusUpdate);
        }