Interface CardFields
colorManaCost(card: Card): Set<string>;
colorUnion(card: Card): readonly string[];
langCode(card: Card): string;
manaCost(card: Card): string;
partsCMC(card: Card): number[];
partsColors(card: Card): Colors[];
partsManaCost(card: Card): string[];
partsName(card: Card): string[];
partsOracleText(card: Card): string[];
partsPrintedName(card: Card): string[];
partsTypeLine(card: Card): string[];
}
Methods
colorManaCost
colorUnion
Calculate union for
colorsfield taking into account card faces.Parameters
- card: Card
Returns readonly string[]
Read only union of all card colors.
langCode
Defer to original CSV language code if available and differs from the Scryfall card
langfield.Alas, currently most online MTG collection services do not associate cards w/ foreign language Scryfall IDs. A temporary solution is to defer to any language set by the collection service exported CSV instead of the found Scryfall card data / language when these values differ. This requires the user to correctly set the language in the online MTG collection service.
Parameters
- card: Card
Returns string
Normalized language code.
manaCost
The mana cost string. Multi-face cards potentially have multiple mana cost seperated by
//.Parameters
- card: Card
Returns string
The mana cost string.
partsCMC
Return all
colorsparts for single or dual face cards.Parameters
- card: Card
Returns number[]
The
colorsstring array parts.
partsColors
partsManaCost
Return all
nameparts for single or dual face cards.Parameters
- card: Card
Returns string[]
mana_costtext parts.
partsName
Return all
nameparts for single or dual face cards.Parameters
- card: Card
Returns string[]
nametext parts.
partsOracleText
Return all
oracle_textparts for single or dual face cards.Parameters
- card: Card
Returns string[]
oracle_texttext parts.
partsPrintedName
Return all
printed_nameparts for single or dual face cards.Parameters
- card: Card
Returns string[]
printed_nametext parts.
partsTypeLine
Return all
type_lineparts for single or dual face cards.Parameters
- card: Card
Returns string[]
type_linetext parts.
Parse card colors from mana cost. Some card categories like
Devoiddo not have an associatedcolorsarray, but do have a mana cost potentially with casting colors.