Table of Contents

Class Attack

Namespace
TcgDex.Models
Assembly
TcgDex.CSharpSdk.dll

An attack printed on a Pokémon card.

public sealed record Attack : IEquatable<Attack>

Inheritance

Implements

Inherited Members

Properties

BaseDamage

The leading numeric portion of TcgDex.Models.Attack.Damage50 for "50+" — or null when the damage is absent or carries no leading number (for example "×").

[JsonIgnore]
public int? BaseDamage { get; }

Property Value

int?

Cost

The energy required, one entry per energy symbol — for example ["Grass", "Grass", "Colorless"]. These are energy type names, not a count.

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

Property Value

IReadOnlyList<string>

Damage

The printed damage, kept verbatim as text.

[JsonConverter(typeof(FlexibleStringConverter))]
public string? Damage { get; init; }

Property Value

string?

Remarks

The API returns this field as either a JSON number (60) or a JSON string ("50+") depending on the card, so it is normalised to text to avoid losing the modifier. Use TcgDex.Models.Attack.BaseDamage for the numeric part. Attacks that only apply an effect have no damage at all.

Effect

The attack's rules text, if any.

public string? Effect { get; init; }

Property Value

string?

Name

The attack's printed name, or null when the API omits it. Not required: TCGdex serves real cards with a nameless attack — the McDonald's Collection 2017 Pikachu (2017sm-5) has an "Electro Ball" attack with no name in the data — and the SDK degrades to a null name rather than making the whole card unreadable.

public string? Name { get; init; }

Property Value

string?