/// <summary> /// Serialises the set specific information about a card. /// </summary> /// <param name="card">The card to serialise.</param> /// <param name="set">The set the card is from.</param> /// <param name="includeIdColumn">Whether to include the id column in the output.</param> /// <returns>The serialised card set information.</returns> public static string SerialiseCardSet(Card card, Set set, bool includeIdColumn) { var parts = GetPartsForCardSet(card, set, includeIdColumn); return JoinObjectParts(parts); }
/// <summary> /// Gets all the items in the card that are specific to the printing it is in. /// </summary> /// <param name="card">The card to parse.</param> /// <param name="set">The set the card is within.</param> /// <param name="includeIdColumn">Whether to include the id column in the output</param> /// <returns>The parts of the card.</returns> private static List<string> GetPartsForCardSet(Card card, Set set, bool includeIdColumn) { List<string> parts = new List<string>(); if (includeIdColumn) { // Set the id column to NULL so it is auto-incremented parts.Add(null); } parts.Add(card.OracleID.ToString()); parts.Add(set.Code); parts.Add(card.MultiverseID); parts.Add(card.Artist); parts.Add(card.Flavortext?.Replace("\n", "~")); Rarity rarity = RarityExtensions.GetRarityWithName(card.Rarity); parts.Add(rarity.GetSymbol().ToString()); parts.Add(card.Number); return parts; }