pub struct KeywordInterface { /* private fields */ }Implementations§
Source§impl KeywordInterface
impl KeywordInterface
pub fn new(keyword: Keyword, original: impl Into<String>) -> Self
Sourcepub fn get_original(&self) -> &str
pub fn get_original(&self) -> &str
Get the original keyword string (e.g. “Flying”, “Kicker:1 R”).
Sourcepub fn get_keyword(&self) -> Keyword
pub fn get_keyword(&self) -> Keyword
Get the keyword enum variant.
Sourcepub fn get_reminder_text(&self) -> String
pub fn get_reminder_text(&self) -> String
Get the reminder text for this keyword.
Sourcepub fn get_amount(&self) -> i32
pub fn get_amount(&self) -> i32
Get the numeric amount (default 1 for most keywords).
Sourcepub fn get_amount_string(&self) -> String
pub fn get_amount_string(&self) -> String
Get the amount as a string.
Sourcepub fn is_intrinsic(&self) -> bool
pub fn is_intrinsic(&self) -> bool
Whether this keyword is intrinsic to the card.
Sourcepub fn set_intrinsic(&mut self, value: bool)
pub fn set_intrinsic(&mut self, value: bool)
Set whether this keyword is intrinsic.
pub fn set_title(&mut self, title: impl Into<String>)
pub fn set_reminder_text(&mut self, reminder_text: impl Into<String>)
pub fn set_amount(&mut self, amount: i32)
pub fn get_static(&self) -> Option<&StaticAbility>
pub fn set_static(&mut self, st: StaticAbility)
pub fn has_traits(&self) -> bool
pub fn add_trigger(&mut self, trg: Trigger)
pub fn add_replacement(&mut self, repl: ReplacementEffect)
pub fn add_spell_ability(&mut self, sa: SpellAbility)
pub fn add_static_ability(&mut self, st: StaticAbility)
pub fn get_triggers(&self) -> &[Trigger]
pub fn get_replacements(&self) -> &[ReplacementEffect]
pub fn get_abilities(&self) -> &[SpellAbility]
pub fn get_static_abilities(&self) -> &[StaticAbility]
Sourcepub fn redundant(&self, _existing_keywords: &[KeywordInterface]) -> bool
pub fn redundant(&self, _existing_keywords: &[KeywordInterface]) -> bool
Whether this keyword instance is redundant given existing keywords.
Trait Implementations§
Source§impl CardTraitChanges for KeywordInterface
impl CardTraitChanges for KeywordInterface
fn apply_spell_ability(&self, list: Vec<SpellAbility>) -> Vec<SpellAbility>
fn apply_trigger(&self, list: Vec<Trigger>) -> Vec<Trigger>
fn apply_replacement_effect( &self, list: Vec<ReplacementEffect>, ) -> Vec<ReplacementEffect>
fn apply_static_ability(&self, list: Vec<StaticAbility>) -> Vec<StaticAbility>
fn change_text(&mut self)
fn copy(&self, _host: CardId, _lki: bool) -> Box<dyn CardTraitChanges>
Source§impl Clone for KeywordInterface
impl Clone for KeywordInterface
Source§fn clone(&self) -> KeywordInterface
fn clone(&self) -> KeywordInterface
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 KeywordInterface
impl Debug for KeywordInterface
Source§impl HasSVars for KeywordInterface
impl HasSVars for KeywordInterface
fn get_svar(&self, name: &str) -> Option<&str>
fn set_svar(&mut self, name: String, value: String)
fn set_svars(&mut self, new_svars: HashMap<String, String>)
fn get_svars(&self) -> &HashMap<String, String>
fn remove_svar(&mut self, var: &str)
fn has_svar(&self, name: &str) -> bool
Auto Trait Implementations§
impl !RefUnwindSafe for KeywordInterface
impl !UnwindSafe for KeywordInterface
impl Freeze for KeywordInterface
impl Send for KeywordInterface
impl Sync for KeywordInterface
impl Unpin for KeywordInterface
impl UnsafeUnpin for KeywordInterface
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.