Enum genius_invokation::CharacterCard
source · #[non_exhaustive]
pub enum CharacterCard {
Show 27 variants
KamisatoAyaka,
Chongyun,
Diona,
Ganyu,
Kaeya,
Barbara,
Mona,
Xingqiu,
Cyno,
Fischl,
Keqing,
Razor,
Ningguang,
Noelle,
Collei,
Jean,
Sucrose,
Bennett,
Diluc,
Xiangling,
Yoimiya,
MirrorMaiden,
RhodeiaOfLoch,
StonehideLawachurl,
JadeplumeTerrorshroom,
MaguuKenki,
FatuiPyroAgent,
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
KamisatoAyaka
Chongyun
Diona
Ganyu
Kaeya
Barbara
Mona
Xingqiu
Cyno
Fischl
Keqing
Razor
Ningguang
Noelle
Collei
Jean
Sucrose
Bennett
Diluc
Xiangling
Yoimiya
MirrorMaiden
RhodeiaOfLoch
StonehideLawachurl
JadeplumeTerrorshroom
MaguuKenki
FatuiPyroAgent
Implementations§
source§impl CharacterCard
impl CharacterCard
sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Examples found in repository?
More examples
src/deck.rs (line 113)
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let errstr = match self {
Self::TalentRequiresCharacter(card) => {
let talent_name = card.name();
let char_name = card.character().name();
format!("`{talent_name}` requires `{char_name}` to be present in the deck")
},
Self::CharacterAppearsMoreThanOnce(card) => {
let char_name = card.name();
format!("deck contains more than one `{char_name}`")
},
Self::ActionCardAppearsMoreThanTwice(card) => {
let card_name = card.name();
format!("deck contains more than two `{card_name}`")
},
Self::TooManyCharacterCards => "deck has more than three character cards".into(),
Self::TooManyActionCards => "deck has more than 30 action cards".into(),
Self::NotEnoughCharacterCards(x) => {
format!("decks require 3 character cards, only retrieved {x}")
},
Self::NotEnoughActionCards(x) => {
format!("decks require 30 action cards, only retrieved {x}")
},
};
write!(f, "{errstr}")
}pub fn element(&self) -> Element
sourcepub fn weapon(&self) -> Option<WeaponType>
pub fn weapon(&self) -> Option<WeaponType>
The weapon type this character can hold
Returns None for characters listed as “Other Weapon”
pub fn faction(&self) -> Faction
Trait Implementations§
source§impl Clone for CharacterCard
impl Clone for CharacterCard
source§fn clone(&self) -> CharacterCard
fn clone(&self) -> CharacterCard
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for CharacterCard
impl Debug for CharacterCard
source§impl Hash for CharacterCard
impl Hash for CharacterCard
source§impl PartialEq<CharacterCard> for CharacterCard
impl PartialEq<CharacterCard> for CharacterCard
source§fn eq(&self, other: &CharacterCard) -> bool
fn eq(&self, other: &CharacterCard) -> bool
This method tests for
self and other values to be equal, and is used
by ==.