/// <summary> /// The constructor for creating a new Card object. This is called internally by the public static CreateCard method. /// </summary> /// <param name="arenaId">The Unique Identifier of the card on Arena.</param> /// <param name="name">The card's Name.</param> /// <param name="set">The Set that contains the card.</param> /// <param name="collectorNumber">The card's collector number.</param> /// <param name="rarity">The card's Rarity.</param> /// <param name="colors">The card's Color definition.</param> /// <param name="fullName">The string used to identify the specfic card/printing when exporting from or importing to Arena.</param> /// <param name="rank">The card's power ranking used when generating replacement suggestions.</param> /// <param name="type">A string containing the card's types.</param> /// <param name="cost">The card's casting cost.</param> /// <param name="cmc">The card's converted mana cost.</param> /// <param name="scryfallId">The card's unique identifier on Scryfall.</param> private Card(int arenaId, string name, Set set, string collectorNumber, CardRarity rarity, string colors, string fullName, int rank, string type, string cost, int cmc, string scryfallId) { ArenaId = arenaId; Name = name; Set = set; CollectorNumber = collectorNumber; Rarity = rarity; Colors = CardColors.CardColorFromString(colors); FullName = fullName; Rank = rank; Type = type; Cost = cost; Cmc = cmc; ScryfallId = scryfallId; PrintedName = name; if (Rarity == CardRarity.BasicLand || Rarity == CardRarity.Token) { BoosterCost = 0; } else { double cardFreq = WildcardFreq[Rarity]; if (!Set.NotInBooster.Contains(Name)) { cardFreq += BoosterFreq(); } BoosterCost = 1.0 / cardFreq; } }
/// <summary> /// Constructor, sets the fixed property values. /// </summary> /// <param name="colorIdentity">The card's color identity.</param> public CardInfo(string colorIdentity) { ColorIdentity = CardColors.CardColorFromString(colorIdentity); }