Enum genius_invokation::ActionCard
source · pub enum ActionCard {
Equipment(EquipmentCard),
Support(SupportCard),
Event(EventCard),
}Variants§
Implementations§
source§impl ActionCard
impl ActionCard
sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
Examples found in repository?
More examples
src/deck.rs (line 123)
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}")
}sourcepub fn shop_price(&self) -> Option<u16>
pub fn shop_price(&self) -> Option<u16>
pub fn cost(&self) -> CardCost
Trait Implementations§
source§impl Clone for ActionCard
impl Clone for ActionCard
source§fn clone(&self) -> ActionCard
fn clone(&self) -> ActionCard
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 ActionCard
impl Debug for ActionCard
source§impl Hash for ActionCard
impl Hash for ActionCard
source§impl PartialEq<ActionCard> for ActionCard
impl PartialEq<ActionCard> for ActionCard
source§fn eq(&self, other: &ActionCard) -> bool
fn eq(&self, other: &ActionCard) -> bool
This method tests for
self and other values to be equal, and is used
by ==.