public override void Tick(Mat viewportMat, RECT viewportRect)
 {
     if (TryClickTutorialArrow(viewportMat, viewportRect))
     {
     }
     else if (CanMatchTemplate(viewportMat, viewportRect, STAGELINE_NEXT_TAG_MKEY))
     {
         var matchRes     = lastMatchResult;
         var rectRate     = GetMatchSourceRectRate(STAGELINE_NEXT_TAG_MKEY);
         var absoluteRect = matchRes.GetMatchedAbsoluteRect(viewportRect, rectRate);
         var pos          = absoluteRect.GetCenterPos();
         pos.Y = pos.Y + (int)(viewportRect.Height * 0.1400f);
         var emulatorPoint = mumuTools.GetEmulatorPoint(viewportRect, pos);
         mumuTools.DoClick(emulatorPoint);
     }
     else if (TryClickTemplateRect(viewportMat, viewportRect, BTN_CANCEL_MKEY))
     {
         logTools.Debug("StagelineBattle", "Try Click BTN_CANCEL");
     }
     else if (TryClickTemplateRect(viewportMat, viewportRect, BTN_CLOSE_MKEY))
     {
         logTools.Debug("StagelineBattle", "Try Click BTN_CLOSE");
     }
     else if (TryClickTemplateRect(viewportMat, viewportRect, BTN_CONFIRM_OK_MKEY))
     {
         logTools.Debug("StagelineBattle", "Try Click BTN_CONFIRM_OK_MKEY");
     }
     else if (battleSceneHandler(viewportMat, viewportRect))
     {
     }
     else if (defaultHandler(viewportMat, viewportRect))
     {
     }
     else
     {
         mumuTools.DoClick(new Vec2f(0.1f, 0.8f));
         //ClickTab(viewportRect, PCRTab.Battle);
         //Thread.Sleep(2000);
         //mumuTools.DoClick(new Vec2f(0.6273f, 0.3891f));//主线冒险
     }
 }
        public bool TryClickTemplateRect(Mat viewportMat, RECT viewportRect, string type, string imgName)
        {
            var matchResult = GetMatchTemplateResult(viewportMat, viewportRect, type, imgName);

            if (!matchResult.Success)
            {
                return(false);
            }
            var matchSourceRectRate = GetMatchSourceRectRate(type, imgName);
            var rectToViewport      = matchResult.GetMatchedAbsoluteRect(viewportRect, matchSourceRectRate);
            var centerPos           = rectToViewport.GetCenterPos();
            var emulatorPoint       = mumuTools.GetEmulatorPoint(viewportRect, centerPos);

            mumuTools.DoClick(emulatorPoint);
            return(true);
        }