Table of Contents

Class Card

Namespace
TcgDex.Models
Assembly
TcgDex.CSharpSdk.dll

A full card, as returned by the single-card endpoint.

public sealed record Card : IEquatable<Card>

Inheritance

Implements

Inherited Members

Extension Methods

Remarks

Which fields are populated depends on TcgDex.Models.Card.Category. Pokémon carry TcgDex.Models.Card.Hp, TcgDex.Models.Card.Types, TcgDex.Models.Card.Attacks and the rest of the battle data; Trainers carry TcgDex.Models.Card.TrainerType and TcgDex.Models.Card.Effect; Energy cards carry TcgDex.Models.Card.EnergyType. Anything category-specific is nullable because the API omits it entirely rather than sending a null.

The API has no type field for a card's kind — that is TcgDex.Models.Card.Category. TcgDex.Models.Card.Types is a different thing: a Pokémon's elemental types.

Properties

Abilities

The card's abilities.

public IReadOnlyList<Ability> Abilities { get; init; }

Property Value

IReadOnlyList<Ability>

Attacks

The card's attacks.

public IReadOnlyList<Attack> Attacks { get; init; }

Property Value

IReadOnlyList<Attack>

Boosters

Boosters this card can be pulled from.

public IReadOnlyList<Booster> Boosters { get; init; }

Property Value

IReadOnlyList<Booster>

Category

The card's kind: "Pokemon", "Trainer" or "Energy". See TcgDex.Models.CardCategories for the known values.

public required string Category { get; init; }

Property Value

string

Remarks

Kept as text rather than an enum so that a category added by the API in future deserializes instead of throwing.

Description

Flavour text.

public string? Description { get; init; }

Property Value

string?

DexId

National Pokédex numbers this card depicts.

public IReadOnlyList<int> DexId { get; init; }

Property Value

IReadOnlyList<int>

Effect

The card's rules text.

public string? Effect { get; init; }

Property Value

string?

EnergyType

Whether this is "Normal" or "Special" energy.

public string? EnergyType { get; init; }

Property Value

string?

EvolveFrom

The Pokémon this one evolves from.

public string? EvolveFrom { get; init; }

Property Value

string?

Hp

Hit points.

public int? Hp { get; init; }

Property Value

int?

Id

The card identifier, in {setId}-{localId} form.

public required string Id { get; init; }

Property Value

string

Illustrator

The illustrator's name.

public string? Illustrator { get; init; }

Property Value

string?

Image

Base image URL without a file extension, or null when the card has no artwork on record.

public string? Image { get; init; }

Property Value

string?

Tournament legality.

public Legality? Legal { get; init; }

Property Value

Legality?

LocalId

The card's number within its set. Not necessarily numeric.

[JsonConverter(typeof(FlexibleStringConverter))]
public required string LocalId { get; init; }

Property Value

string

Remarks

TCGdex documents this as "String or Number", so an unquoted value is read as text rather than throwing. Every card the API currently serves quotes it; the converter is here because this property is required, so one unquoted value would fail the entire card.

Name

The card's printed name.

public required string Name { get; init; }

Property Value

string

Pricing

Market pricing across the whole card.

public Pricing? Pricing { get; init; }

Property Value

Pricing?

Rarity

The card's rarity, for example "Common".

public string? Rarity { get; init; }

Property Value

string?

RegulationMark

The regulation mark letter, on modern cards.

public string? RegulationMark { get; init; }

Property Value

string?

Resistances

Types this Pokémon resists.

public IReadOnlyList<WeaknessOrResistance> Resistances { get; init; }

Property Value

IReadOnlyList<WeaknessOrResistance>

Retreat

The retreat cost, in energy.

public int? Retreat { get; init; }

Property Value

int?

Set

The set this card belongs to.

public required SetBrief Set { get; init; }

Property Value

SetBrief

Stage

The card's evolution stage, for example "Basic" or "Stage1". Not exclusive to Pokémon — Energy cards carry it too.

public string? Stage { get; init; }

Property Value

string?

Suffix

The card's suffix, for example "EX" or "ex". Case is meaningful — the two denote different eras.

public string? Suffix { get; init; }

Property Value

string?

TrainerType

The Trainer subtype, for example "Item", "Supporter", "Tool" or "Stadium".

public string? TrainerType { get; init; }

Property Value

string?

Types

Elemental types, for example ["Grass"].

public IReadOnlyList<string> Types { get; init; }

Property Value

IReadOnlyList<string>

Updated

When this card's record was last updated.

public DateTimeOffset? Updated { get; init; }

Property Value

DateTimeOffset?

Variants

Which printings of this card exist.

public Variants? Variants { get; init; }

Property Value

Variants?

VariantsDetailed

Per-printing detail, including pricing for each printing.

[JsonPropertyName("variants_detailed")]
public IReadOnlyList<DetailedVariant> VariantsDetailed { get; init; }

Property Value

IReadOnlyList<DetailedVariant>

Remarks

Empty rather than null when the API omits it.

Weaknesses

Types this Pokémon is weak to.

public IReadOnlyList<WeaknessOrResistance> Weaknesses { get; init; }

Property Value

IReadOnlyList<WeaknessOrResistance>

Methods

IsCategory(string)

Whether the card's TcgDex.Models.Card.Category matches category, ignoring case.

public bool IsCategory(string category)

Parameters

category string

The category to test, such as "Pokemon".

Returns

bool

true when the categories match.