1
Fork 0
mirror of https://github.com/Steffo99/patched-porobot.git synced 2024-10-16 17:47:29 +00:00

Refactor region_refs so that only the CardRegion enum is kept

This commit is contained in:
Steffo 2022-08-02 10:20:40 +02:00
parent 4a8a5e36bb
commit 7597e073bd
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -13,13 +13,12 @@ pub struct Card {
/// Art assets of this card.
pub assets: Vec<Asset>,
/// Localized names of the regions this card belongs to.
pub regions: Vec<String>,
/// IDs of the regions this card belongs to.
pub region_refs: Vec<String>,
/// Regions this card belongs to.
#[serde(rename = "region_refs")]
pub regions: Vec<CardRegion>,
/// Base attack of the card.
pub attack: i8,
pub attack: i64,
/// Base cost of the card.
pub cost: i8,
/// Base health of the card.
@ -85,6 +84,29 @@ impl Card {
}
/// Regions to which cards can belong to.
#[non_exhaustive]
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
pub enum CardRegion {
Noxus,
Demacia,
Freljord,
ShadowIsles,
Targon,
Ionia,
Shurima,
PiltoverZaun,
BandleCity,
// I'm not sure what this region is for.
Runeterra,
Jhin,
Evelynn,
Bard,
}
/// An art asset associated with a given card.
#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
#[serde(rename_all="camelCase")]