Beispiel #1
0
        private void SearchChampion()
        {
            TemplateMatchResult championSearchMatchResult = _searchFinder.FindTemplateIn(Image);

            Debug.Assert(championSearchMatchResult.IsMatch);

            Vector2 championSearchCenter = championSearchMatchResult.MatchArea.Center();

            _gameWindowTyper.TypeAt((int)championSearchCenter.X, (int)championSearchCenter.Y, Champion);
        }
Beispiel #2
0
        private void EnterLaneInChat()
        {
            TemplateMatchResult chatMatchResult = _chatFinder.FindTemplateIn(Image);

            Debug.Assert(chatMatchResult.IsMatch);

            Vector2 chatCenter = chatMatchResult.MatchArea.Center();

            _gameWindowTyper.TypeAt((int)chatCenter.X, (int)chatCenter.Y, Lane);
            _gameWindowTyper.PressEnter();
        }
        public ImageProcessingResult ProcessImage(IImage image)
        {
            TemplateMatchResult templateMatchResult = _templateFinder.FindTemplateIn(image);

            if (templateMatchResult.IsMatch)
            {
                Rectangle matchBorder = new Rectangle(templateMatchResult.MatchArea.Location,
                                                      templateMatchResult.MatchArea.Size);
                matchBorder.Inflate(BorderMargin, BorderMargin);
                image.Draw(matchBorder);

                Image = image;
                TakeAction(templateMatchResult.MatchArea.Center());

                return(new ImageProcessingResult(_gameStatus, image));
            }

            return(ImageProcessingResult.Failed);
        }