Пример #1
0
    //比赛的一些处理函数
    public bool MonthIsInSignUp(Byte Month)//是否在报名
    {
        tagMonthConfig MonthConfig;

        if (!FishConfig.Instance.m_MatchInfo.m_MonthMap.TryGetValue(Month, out MonthConfig))
        {
            return(false);
        }
        return(MonthConfig.NowIsInSignTime() != 0);
    }
Пример #2
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));
    }
Пример #3
0
    public bool GetMonthNowOrNextSignTime(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.NowIsInSignTime();

        if (TimeID != 0)
        {
            //获取当前的
            tagMonthTime pTimeInfo;
            if (!MonthConfig.m_MonthTime.TryGetValue(TimeID, out pTimeInfo))
            {
                DateBeginTime = new DateTime();
                DateEndTime   = new DateTime();
                return(false);
            }
            DateBeginTime = pTimeInfo.GetNowOrNextSignTime();
            DateEndTime   = DateBeginTime.AddMinutes(pTimeInfo.SignLastMin);
            return(true);
        }
        else
        {
            //获取最近的
            //获取当前比赛 最近的一个 比赛范围
            DateTime LogTime = new DateTime();
            UInt16   LastMin = 0;
            foreach (tagMonthTime var in MonthConfig.m_MonthTime.Values)
            {
                if (LastMin == 0)
                {
                    LogTime = var.GetNowOrNextSignTime();
                    LastMin = var.SignLastMin;
                    continue;
                }
                DateTime SignTime = var.GetNowOrNextSignTime();
                if ((SignTime - LogTime).TotalSeconds > 0)
                {
                    LogTime = SignTime;
                    LastMin = var.SignLastMin;
                    continue;
                }
            }
            DateBeginTime = LogTime;
            DateEndTime   = LogTime.AddMinutes(LastMin);
            return(true);
        }
    }