Ejemplo n.º 1
0
        private decimal GetSpecificRangePercentage(EquitySelectionMode equitySelectionMode)
        {
            var totalCombos = PreflopSelectorItems
                              .Where(x => x.EquitySelectionMode.HasValue)
                              .Sum(x => x.Combos);

            var rangeCombos = 0;

            switch (equitySelectionMode)
            {
            case DriveHUD.ViewModels.EquitySelectionMode.FoldCheck:
                rangeCombos = FoldCheckCombos;
                break;

            case DriveHUD.ViewModels.EquitySelectionMode.Bluff:
                rangeCombos = BluffCombos;
                break;

            case DriveHUD.ViewModels.EquitySelectionMode.Call:
                rangeCombos = CallCombos;
                break;

            case DriveHUD.ViewModels.EquitySelectionMode.ValueBet:
                rangeCombos = ValueBetCombos;
                break;
            }

            return(rangeCombos == totalCombos || totalCombos == 0 ?
                   (decimal)rangeCombos / TotalPossibleCombos :
                   (decimal)rangeCombos / totalCombos);
        }
Ejemplo n.º 2
0
        private void Reset(object obj)
        {
            foreach (var item in PreflopSelectorItems.Where(x => x.IsSelected))
            {
                item.IsSelected = false;
            }

            if (SelectedItem != null)
            {
                SelectedItem.IsMainInSequence = false;
                SelectedItem = null;
            }

            UpdateSlider();
        }
Ejemplo n.º 3
0
        private void UpdateSlider()
        {
            _isSliderManualMove = false;

            var combos = PreflopSelectorItems.Where(x => !x.IsMainInSequence).Sum(model => model.HandSuitsModelList.Count(x => x.IsVisible && x.IsSelected));

            var mainSequnceItem = PreflopSelectorItems.FirstOrDefault(x => x.IsMainInSequence);

            if (mainSequnceItem != null)
            {
                combos += mainSequnceItem.Combos;
            }

            double prct = Math.Round((double)combos * 100 / TotalPossibleCombos, 1);

            SliderValue        = (int)prct * 10;
            SelectedPercentage = prct;

            _isSliderManualMove = true;

            RefreshHandsStatistic();
        }
Ejemplo n.º 4
0
        private void RefreshHandsStatistic()
        {
            var rangeItems = PreflopSelectorItems.Where(x => x.IsSelected).ToArray();

            var totalCombos = rangeItems.Sum(x => x.Combos);
            var ranges      = rangeItems.Select(x => x.Caption).ToList();

            var combosByHandType = source.GetCombosByHandType(ranges);

            foreach (var handStatistic in HandStatistics)
            {
                if (combosByHandType.ContainsKey(handStatistic.HandType))
                {
                    handStatistic.Combos = combosByHandType[handStatistic.HandType];
                }
                else
                {
                    handStatistic.Combos = 0;
                }
            }

            HandStatistics.ForEach(x => x.TotalCombos = totalCombos);
        }
Ejemplo n.º 5
0
        private void Save(object obj)
        {
            if (SelectedItem != null && SelectedItem.IsMainInSequence)
            {
                //update suites
                SelectedItem = new EquityRangeSelectorItemViewModel();
            }

            _notification.CardsContainer.Ranges = new List <EquityRangeSelectorItemViewModel>(PreflopSelectorItems.Where(x => x.IsSelected));
            _notification.Confirmed             = true;

            FinishInteraction();
        }