Exemplo n.º 1
0
        public override void AddStatistic(Playerstatistic statistic)
        {
            base.AddStatistic(statistic);

            foreach (var stat in heatMaps.Keys)
            {
                if (stat.CreateStatDto == null)
                {
                    continue;
                }

                var statDto = stat.CreateStatDto(statistic);

                var cardsRange = ParserUtils.ConvertToCardRange(statistic.Cards);

                if (string.IsNullOrEmpty(cardsRange))
                {
                    continue;
                }

                if (!heatMaps[stat].OccuredByCardRange.ContainsKey(cardsRange))
                {
                    heatMaps[stat].OccuredByCardRange.Add(cardsRange, 0);
                }

                heatMaps[stat].OccuredByCardRange[cardsRange] += statDto.Occurred;
            }
        }
        public virtual void Process(Playerstatistic statistic)
        {
            if (statistic == null || statistic.IsTourney || string.IsNullOrEmpty(statistic.Cards))
            {
                return;
            }

            if (dataPoints == null)
            {
                dataPoints = new Dictionary <string, GraphSerieDataPoint>();
            }

            var cardsRange = ParserUtils.ConvertToCardRange(statistic.Cards);

            if (string.IsNullOrEmpty(cardsRange))
            {
                return;
            }

            if (!dataPoints.ContainsKey(cardsRange))
            {
                dataPoints.Add(cardsRange, new GraphSerieDataPoint());
            }

            dataPoints[cardsRange].Value += statistic.NetWon;
        }
Exemplo n.º 3
0
        public void TestConvertToCardRange(string cards, string expectedRange)
        {
            var actualRange = ParserUtils.ConvertToCardRange(cards);

            Assert.That(actualRange, Is.EqualTo(expectedRange));
        }