Пример #1
0
    public DateTime GetMonthGameEndTime(Byte MonthID)
    {
        tagMonthConfig MonthConfig;

        if (!FishConfig.Instance.m_MatchInfo.m_MonthMap.TryGetValue(MonthID, out MonthConfig))
        {
            DateTime pTime = new DateTime();
            return(pTime);
        }
        Byte TimeID = MonthConfig.NowIsInStartTime();

        if (TimeID != 0)
        {
            //获取当前的
            tagMonthTime pTimeInfo;
            if (!MonthConfig.m_MonthTime.TryGetValue(TimeID, out pTimeInfo))
            {
                DateTime pTime = new DateTime();
                return(pTime);
            }
            DateTime EndTime = pTimeInfo.GetNowOrNextStarTime().AddMinutes(pTimeInfo.SratLastMin);
            //EndTime = EndTime.AddMilliseconds(EndTime.Millisecond * -1).AddSeconds(EndTime.Second * -1);
            return(FishConfig.Instance.GetMinDateTime(EndTime));
        }
        else
        {
            DateTime pTime = new DateTime();
            return(pTime);
        }
    }
Пример #2
0
    public bool MonthIsInStar(Byte Month)//是否在比赛
    {
        tagMonthConfig MonthConfig;

        if (!FishConfig.Instance.m_MatchInfo.m_MonthMap.TryGetValue(Month, out MonthConfig))
        {
            return(false);
        }
        return(MonthConfig.NowIsInStartTime() != 0);
    }
Пример #3
0
    public bool MonthIsStop(Byte Month)//是否已经结束 等待下一次
    {
        tagMonthConfig MonthConfig;

        if (!FishConfig.Instance.m_MatchInfo.m_MonthMap.TryGetValue(Month, out MonthConfig))
        {
            return(false);
        }
        return((MonthConfig.NowIsInSignTime() == 0) && (MonthConfig.NowIsInStartTime() == 0));
    }
Пример #4
0
    public bool GetMonthNowOrNextStarTime(Byte Month, out DateTime DateBeginTime, out DateTime DateEndTime)
    {
        //获取最近的一次的报名时间 如果当前处在报名节点 返回当前正在进行的时间段用于显示
        //获取下次报名的开始时间 已经持续的分钟数
        tagMonthConfig MonthConfig;

        if (!FishConfig.Instance.m_MatchInfo.m_MonthMap.TryGetValue(Month, out MonthConfig))
        {
            DateBeginTime = new DateTime();
            DateEndTime   = new DateTime();
            return(false);
        }
        Byte TimeID = MonthConfig.NowIsInStartTime();

        if (TimeID != 0)
        {
            //获取当前的
            tagMonthTime pTimeInfo;
            if (!MonthConfig.m_MonthTime.TryGetValue(TimeID, out pTimeInfo))
            {
                DateBeginTime = new DateTime();
                DateEndTime   = new DateTime();
                return(false);
            }
            DateBeginTime = pTimeInfo.GetNowOrNextStarTime();
            DateEndTime   = DateBeginTime.AddMinutes(pTimeInfo.SratLastMin);
            return(true);
        }
        else
        {
            //获取最近的
            //获取当前比赛 最近的一个 比赛范围
            DateTime LogTime = new DateTime();
            UInt16   LastMin = 0;
            foreach (tagMonthTime var in MonthConfig.m_MonthTime.Values)
            {
                if (LastMin == 0)
                {
                    LogTime = var.GetNowOrNextStarTime();
                    LastMin = var.SratLastMin;
                    continue;
                }
                DateTime StarTime = var.GetNowOrNextStarTime();
                if ((StarTime - LogTime).TotalSeconds > 0)
                {
                    LogTime = StarTime;
                    LastMin = var.SratLastMin;
                    continue;
                }
            }
            DateBeginTime = LogTime;
            DateEndTime   = LogTime.AddMinutes(LastMin);
            return(true);
        }
    }
Пример #5
0
    public bool MonthIsBeginStar(Byte Month)
    {
        //判断当前比赛是否正好开始
        tagMonthConfig MonthConfig;

        if (!FishConfig.Instance.m_MatchInfo.m_MonthMap.TryGetValue(Month, out MonthConfig))
        {
            return(false);
        }
        return(MonthConfig.NowIsBeginStar());
    }