Esempio n. 1
0
        public bool Matched(ExpectList el, out int MatchCnt, bool getRev)
        {
            //ExpectData data = el.LastData;
            string[] strArr = ChanceCode.Split('+');
            MatchCnt = 0;
            int begid = -1;   //默认为0,多期再去寻找起点

            if (el.Count > 1) //多期考虑
            {
                if (long.Parse(this.ExpectCode) < long.Parse(el.FirstData.Expect))
                {
                    Log("错误", "匹配是否需要关闭错误", "需要关闭的机会早于数据以前,无论是否中奖,立即关闭!");
                    return(true);
                }
                begid = el.IndexOf(this.ExpectCode);
                if (begid < 0)
                {
                    Log("错误", "匹配是否需要关闭错误", "需要关闭的机会不在数据中,无论是否中奖,立即关闭!");
                    return(true);
                }
            }
            //////ExpectData inputEd = el[begid];
            //////Log("计算服务", "获取到期号信息", string.Format("expect:{0};openCode:{1}",inputEd.Expect,inputEd.OpenCode));
            for (int ei = begid + 1; ei < el.Count; ei++)
            {
                ExpectData data = el[ei];
                for (int k = 0; k < strArr.Length; k++)
                {
                    //Log("计算服务", string.Format("循环检查进入期数后的期数是否命中机会:{0}", ChanceCode), string.Format("expect:{0};openCode:{1}", data.Expect, data.OpenCode));
                    string   UseCode = getRev ? getRevChance(strArr[k]) : strArr[k];
                    string[] arr     = UseCode.Trim().Split('/');
                    string   strSer  = arr[0].Trim();
                    string   strCar  = arr[1].Trim();
                    for (int i = 0; i < strSer.Length; i++)
                    {
                        string strSerNo = strSer.Substring(i, 1).Trim();
                        int    iNo      = int.Parse(strSerNo);
                        if (iNo == 0)
                        {
                            iNo = 10;
                        }
                        for (int j = 0; j < strCar.Length; j++)
                        {
                            string strCarNo = strCar.Substring(j, 1).Trim();
                            if (strCarNo == data.ValueList[iNo - 1])
                            {
                                MatchCnt++;
                            }
                        }
                    }
                }
                if (MatchCnt > 0)//任何一期命中都需要关闭
                {
                    break;
                }
            }
            if (MatchCnt > 0)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
 public bool Matched(ExpectList data, out int MatchCnt)
 {
     MatchCnt = 0;
     return(Matched(data, out MatchCnt, false));
 }