diff --git a/src/schema/card.rs b/src/schema/card.rs index c9bf52a..15b2af0 100644 --- a/src/schema/card.rs +++ b/src/schema/card.rs @@ -11,7 +11,9 @@ use super::rarity::CardRarity; use super::speed::SpellSpeed; -/// A single Legends of Runeterra card as represented in the data files from [Data Dragon](https://developer.riotgames.com/docs/lor). +/// A single Legends of Runeterra card. +/// +/// The information is represented in a developer-friendly manner, but it can be serialized and deserialized via [serde] in the exact same format used in Data Dragon. #[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)] #[serde(rename_all="camelCase")] pub struct Card { @@ -23,6 +25,8 @@ pub struct Card { pub name: String, /// The [CardType] of the card. + /// + /// The `r#` prefix is required by the Rust syntax, since `type` is a reserved keyword. #[serde(rename = "type")] pub r#type: CardType, @@ -70,20 +74,20 @@ pub struct Card { #[serde(rename = "spellSpeed")] pub spell_speed_localized: String, - /// List of keywords of this card. + /// [Vec] of [CardKeyword]s of the card. #[serde(rename="keywordRefs")] pub keywords: Vec, - /// Localized names of keywords of this card. + /// [Vec] of localized names of [CardKeyword]s of the card. #[deprecated = "Only for re-serialization purposes, use keywords instead!"] #[serde(rename="keywords")] pub keywords_localized: Vec, - /// Localized description of the card, in XML. + /// Localized description of the card, in pseudo-XML. pub description: String, /// Localized description of the card, in plain text. pub description_raw: String, - /// Localized level up text of the card, in XML. + /// Localized level up text of the card, in pseudo-XML. /// /// If the card has no level up text, contains an empty string. pub levelup_description: String, @@ -92,12 +96,12 @@ pub struct Card { /// If the card has no level up text, contains an empty string. pub levelup_description_raw: String, - /// [Codes](code) of other cards associated with this one. + /// [Vec] with [code]s of other cards associated with this one. /// /// To access references to the cards themselves, use [associated_cards]. #[serde(rename = "associatedCardRefs")] pub associated_card_codes: Vec, - /// [Names](name) of other cards associated with this one. + /// [Vec] with [name]s of other cards associated with this one. /// /// Sometimes, it may be missing some references. #[deprecated = "Only for re-serialization purposes, use associated_card_codes instead!"] @@ -109,9 +113,17 @@ pub struct Card { /// Name of the artist who drew the card. pub artist_name: String, - /// The subtypes the card has, such as `PORO`. + /// The subtypes the card has, such as `"PORO"`. + /// + /// Beware of Riot's inconsistent capitalization! + /// + /// TODO: Make this a enum. pub subtypes: Vec, - /// The [CardSupertype] the card belongs to, such as `Champion`. + /// The supertype the card belongs to, such as `"Champion"`. + /// + /// Beware of Riot's inconsistent capitalization! + /// + /// TODO: Make this a enum. pub supertype: String, } diff --git a/src/schema/keyword.rs b/src/schema/keyword.rs index e72a7c3..1bd6211 100644 --- a/src/schema/keyword.rs +++ b/src/schema/keyword.rs @@ -6,7 +6,7 @@ #[non_exhaustive] #[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)] pub enum CardKeyword { - /// Overwhelm on spells. + /// Like [CardKeyword::Overwhelm], but on [super::CardType::Spell]s. /// /// > Inflicts damage beyond what would kill the target(s) to the enemy Nexus. SpellOverwhelm, diff --git a/src/schema/type.rs b/src/schema/type.rs index b8a0ed3..f571070 100644 --- a/src/schema/type.rs +++ b/src/schema/type.rs @@ -1,4 +1,4 @@ -//! Module defining [Type]. +//! Module defining [CardType]. /// A possible card type.