예제 #1
0
 public static bool NeedDrawCell(BetOddType betOddType, DisplayColumnType displayColumn)
 {
     DisplayColumnType displayColumnType;
     return _displayColumnOddMap.TryGetValue(betOddType, out displayColumnType) && displayColumn.HasFlag(displayColumnType);
 }
예제 #2
0
 internal static float GetOddValue(SportType sportType, BetOddType win1, List<Dictionary<BetOddType, BetItemTransport>> list)
 {
     throw new NotImplementedException();
 }
예제 #3
0
 private static float BetOddRoi(BetOddType[] roiOdds, List<KeyValuePair<BetOddType, BetItemTransport>> vals)
 {
     var internalDataGood = true;
     var oddInternal = new float[roiOdds.Length];
     for (var i = 0; i < roiOdds.Length; i++) {
         var roiOdd = roiOdds[i];
         var odd = vals.Where(v => v.Key == roiOdd).MaxOrDefault(v => v.Value.Odd, default(float));
         if (odd == default(float)) {
             internalDataGood = false;
             continue;
         }
         oddInternal[i] = 1/(odd);
     }
     return internalDataGood ? (100/oddInternal.Sum() - 100) : default(float);
 }
예제 #4
0
 public static float GetOddValue(SportType sportType, BetOddType betOddType, List<Dictionary<BetOddType, BetItemTransport>> bets, Func<IEnumerable<Dictionary<BetOddType, BetItemTransport>>, Func<Dictionary<BetOddType, BetItemTransport>, float>, float> func = null)
 {
     if (bets == null || !BetHelper.SportTypeWithOdds[sportType].Contains(betOddType)) {
         return default(int);
     }
     func = func ?? Enumerable.Average;
     var betsToCalc = bets.Where(b => {
         BetItemTransport betItem;
         return b.TryGetValue(betOddType, out betItem) && betItem.Odd != default(float);
     }).ToArray();
     return betsToCalc.Any() ? func(betsToCalc, b => b[betOddType].Odd) : default(float);
 }