Пример #1
0
        public virtual string Hash(params GameTag[] ignore)
        {
            var str = _data.Hash(ignore);

            str.Append("[O:");
            str.Append(OrderOfPlay.ToString());
            str.Append($"][EN:{Enchants.Count}");
            Enchants.ForEach(p => str.Append(p.Hash));
            str.Append($"][TR:{Triggers.Count}");
            Triggers.ForEach(p => str.Append(p.Hash));
            str.Append("]");
            return(str.ToString());
        }
Пример #2
0
 private IEnumerable <DeckStatsDataRecord> GetFirstSecondWinrateData(
     OrderOfPlay orderOfPlay,
     Func <DataModel.Game, SerializableVersion> groupByVersion,
     Func <DataModel.Game, string> groupByOpponnetClass)
 {
     return(GamesList
            .GroupBy(g => new { D = GetPropertyValue(g, GroupBy), VS = groupByVersion(g), OC = groupByOpponnetClass(g) })
            .Select(d => new DeckStatsDataRecord
     {
         Deck = d.Key.D,
         DeckVersion = d.Key.VS,
         Opp = d.Key.OC,
         Win = d.Where(d2 => d2.Outcome == GameOutcome.Victory && d2.OrderOfPlay == orderOfPlay).Count() +
               "-" + d.Where(d2 => d2.Outcome == GameOutcome.Defeat && d2.OrderOfPlay == orderOfPlay).Count(),
         WinPerc = (double)d.Where(g => g.Outcome == GameOutcome.Victory && g.OrderOfPlay == orderOfPlay).Count() / d.Where(g => g.OrderOfPlay == OrderOfPlay.First).Count() * 100
     }));
 }