Esempio n. 1
0
        //范围截取的(奖金最高、 概率最高)Types = 1 是奖金最高 Types = 2是概率最高
        private List<string> GetRangeBonus(int Min, int Types, List<string> ListR)
        {
            List<Netball> List = DataGrid1.ItemsSource as List<Netball>;

            List<Odds> ListOdd = new List<Odds>();
            for (int i = 0; i < List.Count; i++)
            {
                //胜平负的赔率类
                Odds Odd = new Odds();

                Odd.Frist = List[i].FristOdds;
                Odd.Next = List[i].NextOdds;
                Odd.Last = List[i].LastOdds;

                Odd.Id = List[i].Id;
                ListOdd.Add(Odd);
            }

            List<string> ListStr = new List<string>();
            List<NumOrders> ListNumOrder = new List<NumOrders>();

            int j = 0;
            double Odds = 1.00;
            #region
            foreach (string s in ListR)
            {
                NumOrders Orders = new NumOrders();
                foreach (char c in s)
                {
                    switch (c)
                    {
                        case '3':
                            Odds *= ListOdd[j].Frist;
                            break;
                        case '1':
                            Odds *= ListOdd[j].Next;
                            break;
                        case '0':
                            Odds *= ListOdd[j].Last;
                            break;
                        default:
                            Odds *= 1.00;
                            break;
                    }
                    j++;
                }

                Orders.Nums = s;
                Orders.Odds = Odds * 2;
                ListNumOrder.Add(Orders);//ListNumOrder里放的是 投注号码和号码赔率

                j = 0;
                Odds = 1.00;
            }
            #endregion

            ListNumOrder.Sort(delegate(NumOrders order1, NumOrders order2) { return Comparer<double>.Default.Compare(order1.Odds, order2.Odds); });

            if (Types == 1)
            {
                int k = 1;
                for (int i = ListNumOrder.Count - 1; i >= 0; i--)
                {
                    if (k <= Min)
                    {
                        ListStr.Add(ListNumOrder[i].Nums);
                        k++;
                    }
                    else
                    {
                        break;
                    }
                }
            }
            else
            {
                for (int n = 0; n < ListNumOrder.Count; n++)
                {
                    if (n < Min)
                    {
                        ListStr.Add(ListNumOrder[n].Nums);
                    }
                    else
                    {
                        break;
                    }
                }
            }

            return ListStr;
        }
Esempio n. 2
0
        //指数过的的(奖金范围)
        private List<string> GetIndexBonus(double Min, double Max, List<string> ListR)
        {
            List<Netball> List = DataGrid1.ItemsSource as List<Netball>;

            List<Odds> ListOdd = new List<Odds>();
            for (int i = 0; i < List.Count; i++)
            {
                //胜平负的赔率类
                Odds Odd = new Odds();

                Odd.Frist = List[i].FristOdds;
                Odd.Next = List[i].NextOdds;
                Odd.Last = List[i].LastOdds;

                Odd.Id = List[i].Id;
                ListOdd.Add(Odd);
            }

            List<string> ListStr = new List<string>();

            int j = 0;
            double Odds = 1.00;
            #region
            foreach (string s in ListR)
            {
                foreach (char c in s)
                {
                    switch (c)
                    {
                        case '3':
                            Odds *= ListOdd[j].Frist;
                            break;
                        case '1':
                            Odds *= ListOdd[j].Next;
                            break;
                        case '0':
                            Odds *= ListOdd[j].Last;
                            break;
                        default:
                            Odds *= 1.00;
                            break;
                    }
                    j++;
                }
                if (Odds * 2 >= Min && Odds * 2 <= Max)
                {
                    ListStr.Add(s);
                }

                j = 0;
                Odds = 1.00;
            }
            #endregion
            return ListStr;
        }