コード例 #1
0
        private bool CheckIsCanStartBattle(int num)
        {
            //int curletfTimes = _maxTime - _levelVo.CurChallengeTime;
            //if(curletfTimes<=0)
            //{
            //    FlowText.ShowMessage(I18NManager.Get("Visit_TimeNotEnough"));
            //    return false;
            //}

            if (num == 0)
            {
                num = 1;
            }

            if (num > _visitVo.MaxVisitTime - _visitVo.CurVisitTime)//探班次数不足
            {
                if (_visitVo.CurWeather != VISIT_WEATHER.Fine)
                {
                    string showText = I18NManager.Get("Visit_TimeNotEnoughAndEnterWeater");
                    PopupManager.ShowConfirmWindow(showText).WindowActionCallback = evt =>
                    {
                        if (evt == WindowEvent.Ok)
                        {
                            EventDispatcher.TriggerEvent(EventConst.VisitLevelItemGotoWeather);
                            Close();
                        }
                        Show();
                    };
                }
                else
                {
                    string showText = I18NManager.Get("Visit_TimeNotEnough");
                    PopupManager.ShowAlertWindow(showText).WindowActionCallback = evt =>
                    {
                        Show();
                    };
                }
                return(false);
            }

            if (num > VisitVo.MaxSingleVisitTime - _levelVo.CurChallengeTime)
            {
                ShowResetWindow();
                return(false);
            }


            //if(GlobalData.PlayerModel.PlayerVo.EncourageEnergy < 5 * num)
            //{
            //    FlowText.ShowMessage(I18NManager.Get("Visit_PowerNotEnough"));
            //    return false;
            //}

            return(true);
        }