1use crate::locale;
2use crate::pokemon;
3use crate::set;
4
5use serde::{Deserialize, Serialize};
6use std::collections::BTreeSet;
7
8#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
9pub struct Card {
10 pub id: Id,
11 pub set: set::Id,
12 pub name: locale::Map,
13 pub types: BTreeSet<Type>,
14 pub rarity: Rarity,
15 pub variants: Variants,
16 pub illustrator: Option<String>,
17 pub pokedex: Vec<pokemon::Id>,
18}
19
20#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Serialize, Deserialize)]
21pub struct Id(pub(crate) String);
22
23impl Id {
24 pub fn as_str(&self) -> &str {
25 &self.0
26 }
27}
28
29#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Default, Serialize, Deserialize)]
30pub enum Rarity {
31 #[default]
32 None,
33 Common,
34 Uncommon,
35 Rare,
36 HoloRare,
37 HoloRareLvx,
38 HoloRareV,
39 HoloRareVmax,
40 HoloRareVstar,
41 ShinyRare,
42 ShinyRareV,
43 ShinyRareVmax,
44 DoubleRare,
45 AceSpecRare,
46 AmazingRare,
47 RadiantRare,
48 RarePrime,
49 Legend,
50 ClassicCollection,
51 UltraRare,
52 ShinyUltraRare,
53 SecretRare,
54 FullArtTrainer,
55 IllustrationRare,
56 SpecialIllustrationRare,
57 HyperRare,
58}
59
60#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
61pub enum Type {
62 Grass,
63 Fire,
64 Water,
65 Lightning,
66 Psychic,
67 Fighting,
68 Darkness,
69 Metal,
70 Fairy,
71 Dragon,
72 Colorless,
73}
74
75#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
76pub struct Variants {
77 pub first_edition: bool,
78 pub holo: bool,
79 pub normal: bool,
80 pub reverse: bool,
81 pub w_promo: bool,
82}