public static bool NeedDrawCell(BetOddType betOddType, DisplayColumnType displayColumn) { DisplayColumnType displayColumnType; return _displayColumnOddMap.TryGetValue(betOddType, out displayColumnType) && displayColumn.HasFlag(displayColumnType); }
internal static float GetOddValue(SportType sportType, BetOddType win1, List<Dictionary<BetOddType, BetItemTransport>> list) { throw new NotImplementedException(); }
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); }
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); }