public Deck(DeckType type, string name, CardClass cardClass, IEnumerable <int> cards) { Type = type; Name = name; Class = cardClass; Cards = CardSorting.Sort(cards.GroupBy(x => x).Select(x => new Card(x.Key, x.Count()))); }
public Deck(DeckType type, HearthDb.Deckstrings.Deck deck) { Type = type; Name = deck.Name; DeckId = deck.DeckId; Cards = CardSorting.Sort(deck.GetCards().Select(card => new Card(card.Key, card.Value))); Class = deck.GetHero().Class; }
public Deck(DeckType type, HearthMirror.Objects.Deck deck) { Type = type; Name = deck.Name; DeckId = deck.Id; Cards = CardSorting.Sort(deck.Cards.Select(x => new Card(x))); Class = HearthDb.Cards.All.TryGetValue(deck.Hero, out var hero) ? hero.Class : CardClass.INVALID; }