public void BuildRarityItems() { foreach (var cardItem in Cards) { if (!(Rarities.FirstOrDefault(x => x.Rarity == cardItem.MagicCard.rarity) is OLVRarityItem rarityItem)) { rarityItem = new OLVRarityItem(this, cardItem.MagicCard.Edition, cardItem.MagicCard.rarity); Rarities.Add(rarityItem); Rarities.Sort(); } rarityItem.Cards.Add(cardItem); } }
public void AddRarity(OLVRarityItem rarity) { Rarities.Add(rarity); }