Skip to main content

CardState

Struct CardState 

Source
pub struct CardState {
Show 40 fields pub state_name: CardStateName, pub name: String, pub type: CardType, pub changed_type: Option<CardTypeView>, pub mana_cost: ManaCost, pub perpetual_adjusted_mana_cost: Option<ManaCost>, pub color: ColorSet, pub oracle_text: String, pub functional_variant_name: Option<String>, pub flavor_name: Option<String>, pub base_power: i32, pub base_toughness: i32, pub base_power_string: Option<String>, pub base_toughness_string: Option<String>, pub base_loyalty: String, pub base_defense: String, pub intrinsic_keywords: KeywordCollection, pub attraction_lights: Option<HashSet<i32>>, pub abilities: FCollection<SpellAbility>, pub triggers: FCollection<Trigger>, pub replacement_effects: FCollection<ReplacementEffect>, pub static_abilities: FCollection<StaticAbility>, pub image_key: String, pub s_vars: HashMap<String, String>, pub ability_for_trigger: HashMap<String, SpellAbility>, pub cached_keywords: KeywordCollection, pub rarity: CardRarity, pub set_code: String, pub card: Card, pub land_ability: Option<SpellAbility>, pub aura_ability: Option<SpellAbility>, pub permanent_ability: Option<SpellAbility>, pub loyalty_rep: Option<ReplacementEffect>, pub defense_rep: Option<ReplacementEffect>, pub saga_rep: Option<ReplacementEffect>, pub adventure_rep: Option<ReplacementEffect>, pub omen_rep: Option<ReplacementEffect>, pub manifest_up: Option<SpellAbility>, pub cloak_up: Option<SpellAbility>, pub land_trait_changes: LandTraitChanges,
}
Expand description

Port of Java CardState.

Fields§

§state_name: CardStateName§name: String§type: CardType§changed_type: Option<CardTypeView>§mana_cost: ManaCost§perpetual_adjusted_mana_cost: Option<ManaCost>§color: ColorSet§oracle_text: String§functional_variant_name: Option<String>§flavor_name: Option<String>§base_power: i32§base_toughness: i32§base_power_string: Option<String>§base_toughness_string: Option<String>§base_loyalty: String§base_defense: String§intrinsic_keywords: KeywordCollection§attraction_lights: Option<HashSet<i32>>§abilities: FCollection<SpellAbility>§triggers: FCollection<Trigger>§replacement_effects: FCollection<ReplacementEffect>§static_abilities: FCollection<StaticAbility>§image_key: String§s_vars: HashMap<String, String>§ability_for_trigger: HashMap<String, SpellAbility>§cached_keywords: KeywordCollection§rarity: CardRarity§set_code: String§card: Card§land_ability: Option<SpellAbility>§aura_ability: Option<SpellAbility>§permanent_ability: Option<SpellAbility>§loyalty_rep: Option<ReplacementEffect>§defense_rep: Option<ReplacementEffect>§saga_rep: Option<ReplacementEffect>§adventure_rep: Option<ReplacementEffect>§omen_rep: Option<ReplacementEffect>§manifest_up: Option<SpellAbility>§cloak_up: Option<SpellAbility>§land_trait_changes: LandTraitChanges

Implementations§

Source§

impl CardState

Source

pub fn new(card: Card, name: CardStateName) -> Self

Source

pub fn get_card(&self) -> &Card

Source

pub fn get_name(&self) -> &str

Source

pub fn set_name(&mut self, name: String)

Source

pub fn get_state_name(&self) -> CardStateName

Source

pub fn get_type_with_changes(&self) -> &CardTypeView

Source

pub fn update_types(&mut self)

Source

pub fn update_types_for_view(&self)

Source

pub fn get_type(&self) -> &CardTypeView

Source

pub fn add_type(&mut self, type_value: String)

Source

pub fn add_types<I: IntoIterator<Item = String>>(&mut self, type_values: I)

Source

pub fn set_type(&mut self, type_value: CardType)

Source

pub fn remove_card_types_with_sanitize(&mut self, _sanitize: bool)

Source

pub fn get_mana_cost(&self) -> &ManaCost

Source

pub fn set_mana_cost(&mut self, mana_cost: ManaCost)

Source

pub fn calculate_perpetual_adjusted_mana_cost_for_state(&mut self)

Source

pub fn get_perpetual_adjusted_mana_cost(&self) -> &ManaCost

Source

pub fn get_color(&self) -> ColorSet

Source

pub fn add_color(&mut self, color: ColorSet)

Source

pub fn set_color(&mut self, color: ColorSet)

Source

pub fn get_oracle_text(&self) -> &str

Source

pub fn set_oracle_text(&mut self, oracle_text: String)

Source

pub fn get_functional_variant_name(&self) -> Option<&str>

Source

pub fn set_functional_variant_name( &mut self, functional_variant_name: Option<String>, )

Source

pub fn get_flavor_name(&self) -> Option<&str>

Source

pub fn set_flavor_name(&mut self, flavor_name: Option<String>)

Source

pub fn get_base_power(&self) -> i32

Source

pub fn set_base_power(&mut self, base_power: i32)

Source

pub fn get_base_toughness(&self) -> i32

Source

pub fn set_base_toughness(&mut self, base_toughness: i32)

Source

pub fn get_base_power_string(&self) -> Option<&str>

Source

pub fn get_base_toughness_string(&self) -> Option<&str>

Source

pub fn set_base_power_string(&mut self, value: Option<String>)

Source

pub fn set_base_toughness_string(&mut self, value: Option<String>)

Source

pub fn get_base_loyalty(&self) -> &str

Source

pub fn set_base_loyalty(&mut self, value: String)

Source

pub fn get_base_defense(&self) -> &str

Source

pub fn set_base_defense(&mut self, value: String)

Source

pub fn get_attraction_lights(&self) -> Option<&HashSet<i32>>

Source

pub fn set_attraction_lights(&mut self, attraction_lights: Option<HashSet<i32>>)

Source

pub fn get_cached_keywords(&self) -> Vec<&KeywordInstanceData>

Source

pub fn set_cached_keywords(&mut self, collection: KeywordCollection)

Source

pub fn has_keyword_enum(&self, key: Keyword) -> bool

Source

pub fn get_intrinsic_keywords(&self) -> Vec<&KeywordInstanceData>

Source

pub fn has_intrinsic_keyword_state(&self, keyword: &str) -> bool

Source

pub fn set_intrinsic_keywords( &mut self, _intrinsic_keywords: Vec<KeywordInterface>, _lki: bool, )

Source

pub fn update_keywords_cache_for_state(&mut self)

Source

pub fn add_intrinsic_keyword_with_init_traits( &mut self, keyword: String, _init_traits: bool, ) -> Option<KeywordInterface>

Source

pub fn add_intrinsic_keywords_for_state( &mut self, keywords: Vec<String>, init_traits: bool, ) -> bool

Source

pub fn remove_intrinsic_keyword_for_state(&mut self, keyword: &str) -> bool

Source

pub fn get_spell_abilities(&self) -> FCollectionView<SpellAbility>

Source

pub fn get_mana_abilities(&self) -> FCollectionView<SpellAbility>

Source

pub fn get_non_mana_abilities(&self) -> FCollectionView<SpellAbility>

Source

pub fn update_spell_abilities(&self, _new_col: &mut FCollection<SpellAbility>)

Source

pub fn get_land_trait_changes(&self) -> &LandTraitChanges

Source

pub fn get_intrinsic_spell_abilities(&self) -> Vec<SpellAbility>

Source

pub fn get_first_ability(&self) -> Option<SpellAbility>

Source

pub fn get_first_spell_ability(&self) -> Option<SpellAbility>

Source

pub fn get_first_spell_ability_with_fallback(&self) -> Option<SpellAbility>

Source

pub fn get_aura_spell(&self) -> Option<SpellAbility>

Source

pub fn has_spell_ability_id(&self, id: i32) -> bool

Source

pub fn add_spell_ability_state(&mut self, ability: SpellAbility) -> bool

Source

pub fn get_triggers(&self) -> FCollectionView<Trigger>

Source

pub fn has_trigger_id(&self, id: i32) -> bool

Source

pub fn add_trigger_state(&mut self, trigger: Trigger) -> bool

Source

pub fn get_static_abilities(&self) -> FCollectionView<StaticAbility>

Source

pub fn add_static_ability_state( &mut self, static_ability: StaticAbility, ) -> bool

Source

pub fn remove_static_ability_state( &mut self, _static_ability: StaticAbility, ) -> bool

Source

pub fn get_replacement_effects(&self) -> FCollectionView<ReplacementEffect>

Source

pub fn add_replacement_effect_state( &mut self, replacement_effect: ReplacementEffect, ) -> bool

Source

pub fn has_replacement_effect_id(&self, id: i32) -> bool

Source

pub fn get_replacement_effect(&self, id: i32) -> Option<ReplacementEffect>

Source

pub fn get_foil(&self) -> i32

Source

pub fn copy_from_state(&mut self, _source: &CardState, _lki: bool)

Source

pub fn copy_from_with_trait_base( &mut self, _source: &CardState, _lki: bool, _ctb: &CardTraitBase, )

Source

pub fn add_abilities_from_state(&mut self, _source: &CardState, _lki: bool)

Source

pub fn copy(&self, host: Card, name: CardStateName, _lki: bool) -> CardState

Source

pub fn get_rarity(&self) -> CardRarity

Source

pub fn set_rarity(&mut self, rarity: CardRarity)

Source

pub fn get_set_code(&self) -> &str

Source

pub fn set_set_code(&mut self, set_code: String)

Source

pub fn get_image_key(&self) -> &str

Source

pub fn set_image_key(&mut self, image_key: String)

Source

pub fn get_traits(&self) -> Vec<CardTraitBase>

Source

pub fn reset_original_host(&mut self, _old_host: Card)

Source

pub fn update_changed_text(&mut self)

Source

pub fn change_text_intrinsic( &mut self, _color_map: HashMap<String, String>, _type_map: HashMap<String, String>, )

Source

pub fn has_chapter(&self) -> bool

Source

pub fn get_final_chapter_nr(&self) -> i32

Source

pub fn get_manifest_up(&self) -> Option<SpellAbility>

Source

pub fn get_cloak_up(&self) -> Option<SpellAbility>

Source

pub fn get_ability_for_trigger(&self, svar: String) -> Option<SpellAbility>

Trait Implementations§

Source§

impl Clone for CardState

Source§

fn clone(&self) -> CardState

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CardState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl GameObject for CardState

Source§

fn is_valid_single( &self, restriction: &str, _source_controller: PlayerId, _source: &Card, _spell_ability: &CardTraitBase, ) -> bool

Source§

fn has_property( &self, property: &str, source_controller: PlayerId, _source: &Card, _spell_ability: &CardTraitBase, ) -> bool

Source§

fn can_be_targeted_by(&self, _sa: &SpellAbility) -> bool

Source§

fn is_valid( &self, restrictions: &[String], source_controller: PlayerId, source: &Card, spell_ability: &CardTraitBase, ) -> bool

Source§

impl HasName for CardState

Source§

fn get_name(&self) -> &str

Source§

impl HasSVars for CardState

Source§

fn get_svar(&self, name: &str) -> Option<&str>

Source§

fn set_svar(&mut self, name: String, value: String)

Source§

fn set_svars(&mut self, new_svars: HashMap<String, String>)

Source§

fn get_svars(&self) -> &HashMap<String, String>

Source§

fn remove_svar(&mut self, var: &str)

Source§

fn has_svar(&self, name: &str) -> bool

Source§

impl ITranslatable for CardState

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V