BoringHeroes.ScreenReader.UpdateHeroMounted C# (CSharp) Метод

UpdateHeroMounted() публичный статический Метод

public static UpdateHeroMounted ( CurrentGameState state ) : bool
state BoringHeroes.GameLogic.CurrentGameState
Результат bool
        public static bool UpdateHeroMounted(CurrentGameState state)
        {
            if (ShouldBringToFront) ControlInput.BringHeroesToFront();
            Bitmap src;
            Bitmap sourceImage;
            Bitmap croppedImage;

            try
            {
                src = GrabScreenGDI(gameScreen);
                sourceImage = ChangePixelFormat(src, PixelFormat.Format24bppRgb);

                Tools.Cropper.Rectangle = new Rectangle(0, 700, 70, 250);
                croppedImage = Tools.Cropper.Apply(sourceImage);

                var patternFinder = new ExhaustiveTemplateMatching(0.9f);

                var matches1 = patternFinder.ProcessImage(croppedImage, templateMounted);

                if (matches1.Length > 0)
                {
                    state.Me.IsMounted = true;
                }
                state.Me.IsMounted = false;
                src.Dispose();
                sourceImage.Dispose();
                croppedImage.Dispose();
            }
            catch (Exception e)
            {
            }
            finally
            {
            }
            return false;
        }