Exemplo n.º 1
0
 public LotteryConfigClass_GDKL11(WebRule we, LotteryTypes rs, string name) : base(we, rs, name)
 {
     //cRuleId_S = rules.AllRules["34140101"].BetRule;
     //cRuleId_B = rules.AllRules["34140102"].BetRule;
     //g01_00 = "8010101";//猜冠军
     //g0102_00 = "8020101";//猜冠亚军
     //g0102_01 = "8020201";//猜冠亚军单式
     //cRuleId_S = "8140101";// '前5位定胆
     //cRuleId_B = "8140102";// '后5位定胆
 }
Exemplo n.º 2
0
        public static Dictionary <string, LotteryTypes> getListFromXml(XmlNode node)
        {
            Dictionary <string, LotteryTypes> ret = new Dictionary <string, LotteryTypes>();


            XmlNodeList nodes = node.SelectNodes("Lottery");

            foreach (XmlNode sn in nodes)
            {
                LotteryTypes lt     = new LotteryTypes();
                string       strKey = XmlUtil.GetSubNodeText(sn, "@id");
                lt.LoadXml(sn);
                ret.Add(strKey, lt);
            }
            return(ret);
        }
Exemplo n.º 3
0
 public PK10KindLotteryConfigClass(WebRule we, LotteryTypes rs, string name) : base(we, rs, name)
 {
     g01_00   = "8010101"; //猜冠军
     g0102_00 = "8020101"; //猜冠亚军
     g0102_01 = "8020201"; //猜冠亚军单式
     //cRuleId_S = "8140101";// '前5位定胆
     //cRuleId_B = "8140102";// '后5位定胆
     if (rules.AllRules.ContainsKey("8140101"))
     {
         cRuleId_S = rules.AllRules["8140101"].BetRule;
     }
     if (rules.AllRules.ContainsKey("8140102"))
     {
         cRuleId_B = rules.AllRules["8140102"].BetRule;
     }
 }
Exemplo n.º 4
0
        int getNums(string ccNos, LotteryTypes lts, string nums)
        {
            string pType = ccNos.Substring(0, 1); //A,C,P
            string pVal  = ccNos.Substring(1, 1); //1~8
            int    nVal  = int.Parse(pVal);
            int    ret   = 1;

            switch (pType.ToUpper())
            {
            case "C":
            {
                int     n = nums.Split(' ').Length;
                Decimal c = ProbMath.GetCombination(n, nVal);
                ret = (int)c;
                break;
            }

            case "P":
            {
                //Decimal c = ProbMath.GetFactorial(n, nVal);//11任意5个的组合为C(11,5)
                string[] arr = nums.Split(',');
                int      n   = 1;
                for (int i = 0; i < arr.Length; i++)
                {
                    n = n * arr[i].Split(' ').Length;
                }
                ret = n;        //重复的暂时不考虑,正常应该要考虑到 1-2-3,3-2-1,1-3-2这种情况
                break;
            }

            case "A":
            default:
            {
                int     n = nums.Split(' ').Length;
                Decimal c = ProbMath.GetCombination(n, nVal);        //11任意5个的组合为C(11,5)
                ret = (int)c;
                break;
            }
            }
            return(ret);
        }
Exemplo n.º 5
0
        double getRealOdds(string ccNos, LotteryTypes lts, double orgOdds)
        {
            //ProbMath 概率计算类
            string pType = ccNos.Substring(0, 1); //A,C,P
            string pVal  = ccNos.Substring(1, 1); //1~8
            int    nVal  = int.Parse(pVal);
            double ret   = 0.00;

            switch (pType.ToUpper())
            {
            case "C":
            {
                Decimal c  = ProbMath.GetCombination(lts.elementCount, nVal);        //11任意5个的组合为C(11,5)
                Decimal sc = 1;
                ret = (double)(c / sc);
                break;
            }

            case "P":
            {
                Decimal c  = ProbMath.GetFactorial(lts.elementCount, nVal);       //11任意5个的组合为C(11,5)
                Decimal sc = 1;
                ret = (double)(c / sc);
                break;
            }

            case "A":
            default:
            {
                Decimal c  = ProbMath.GetCombination(lts.elementCount, nVal);       //11任意5个的组合为C(11,5)
                Decimal sc = ProbMath.GetCombination(lts.seletElementCnt, nVal);
                if (nVal > lts.seletElementCnt)
                {
                    sc = ProbMath.GetCombination(lts.elementCount - lts.seletElementCnt, nVal - lts.seletElementCnt);
                }
                ret = Math.Round((double)(c / sc), 2);
                break;
            }
            }
            return((double)Decimal.Round((Decimal)(orgOdds * ret * 2 / 10), 2));;
        }
Exemplo n.º 6
0
        public override string IntsToJsonString(string lotteryName, String ccs, int unit)
        {
            LotteryConfigClass lcc = null;
            WebConfig          wc  = this.config;
            LotteryTypes       lt  = null;

            if (!wc.lotteryTypes.ContainsKey(lotteryName))
            {
                return(ccs);
            }
            lt = wc.lotteryTypes[lotteryName];
            switch (lotteryName)
            {
            case "XYFT":
            {
                lcc = new LotteryConfigClass_XYFT(this, lt, lotteryName);
                break;
            }

            case "GDKL11":
            {
                lcc = new LotteryConfigClass_GDKL11(this, lt, lotteryName);
                break;
            }

            case "PK10":
            default:
            {
                lcc = new PK10KindLotteryConfigClass(this, lt, lotteryName);
                break;
            }
            }
            if (lcc == null)
            {
                return(null);
            }
            lcc.setting = GobalSetting;
            return(lcc.IntsToJsonString(ccs, unit));
        }
Exemplo n.º 7
0
 public void LoadXml(XmlNode doc)
 {
     WebWholeOdds = float.Parse(XmlUtil.GetSubNodeText(doc, "config/@odds"));
     lotteryTypes = LotteryTypes.getListFromXml(doc.SelectSingleNode("config/Lotteries"));
     Units.LoadXml(doc.SelectSingleNode("config/Units"));
 }
Exemplo n.º 8
0
 public XxYLotteryConfigClass(WebRule we, LotteryTypes rs, string name) : base(we, rs, name)
 {
 }
Exemplo n.º 9
0
 public string g0102_01 = "8020201"; //猜冠亚军单式
 protected F2LotteryyConfigClass(WebRule we, LotteryTypes rs, string name) : base(we, rs, name)
 {
 }
Exemplo n.º 10
0
 protected LotteryConfigClass(WebRule we, LotteryTypes rs, string name)
 {
     rules = rs;
     wr    = we;
     Name  = name;
 }