genius_invokation/cards/action/event/
food.rs1use crate::{CardCost};
2
3use super::Price;
4
5#[derive(Debug, Hash, Clone, Copy, PartialEq, Eq)]
6#[non_exhaustive]
7pub enum FoodCard {
8 MondstadtHashBrown,
9 JueyunGuoba,
10 AdeptusTemptation,
11 LotusFlowerCrisp,
12 NorthernSmokedChicken,
13 SweetMadame,
14 MushroomPizza,
15 MintyMeatRolls,
16}
17
18impl super::PlayingCard for FoodCard {
19 fn name(&self) -> &'static str {
20 self.info_dump().0
21 }
22
23 fn shop_price(&self) -> Option<Price> {
24 self.info_dump().1
25 }
26
27 fn cost(&self) -> CardCost {
28 self.info_dump().2
29 }
30
31 fn food(&self) -> Option<FoodCard> {
32 Some(*self)
33 }
34}
35
36impl FoodCard {
37 fn info_dump(&self) -> (&'static str, Option<Price>, CardCost) {
38 match self {
39 Self::MondstadtHashBrown => ("Mondstadt Hash Brown", None, CardCost::ONE),
40 Self::JueyunGuoba => ("Jueyun Guoba", Some(500), CardCost::ZERO),
41 Self::AdeptusTemptation => ("Adeptus' Temptation", Some(500), CardCost::ANY2),
42 Self::LotusFlowerCrisp => ("Lotus Flower Crisp", Some(500), CardCost::ONE),
43 Self::NorthernSmokedChicken => ("Northern Smoked Chicken", Some(500), CardCost::ZERO),
44 Self::SweetMadame => ("Sweet Madame", Some(500), CardCost::ZERO),
45 Self::MushroomPizza => ("Mushroom Pizza", Some(500), CardCost::ONE),
46 Self::MintyMeatRolls => ("Minty Meat Rolls", Some(500), CardCost::ONE),
47 }
48 }
49}
50
51impl super::CardOrd for FoodCard {
52 fn cmp(&self, other: &Self) -> std::cmp::Ordering {
53 (*self as u32).cmp(&(*other as u32))
54 }
55}
56
57impl_from!(Food: FoodCard => crate::EventCard => crate::ActionCard => crate::Card);