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: LandTraitChangesImplementations§
Source§impl CardState
impl CardState
pub fn new(card: Card, name: CardStateName) -> Self
pub fn get_card(&self) -> &Card
pub fn get_name(&self) -> &str
pub fn set_name(&mut self, name: String)
pub fn get_state_name(&self) -> CardStateName
pub fn get_type_with_changes(&self) -> &CardTypeView
pub fn update_types(&mut self)
pub fn update_types_for_view(&self)
pub fn get_type(&self) -> &CardTypeView
pub fn add_type(&mut self, type_value: String)
pub fn add_types<I: IntoIterator<Item = String>>(&mut self, type_values: I)
pub fn set_type(&mut self, type_value: CardType)
pub fn remove_card_types_with_sanitize(&mut self, _sanitize: bool)
pub fn get_mana_cost(&self) -> &ManaCost
pub fn set_mana_cost(&mut self, mana_cost: ManaCost)
pub fn calculate_perpetual_adjusted_mana_cost_for_state(&mut self)
pub fn get_perpetual_adjusted_mana_cost(&self) -> &ManaCost
pub fn get_color(&self) -> ColorSet
pub fn add_color(&mut self, color: ColorSet)
pub fn set_color(&mut self, color: ColorSet)
pub fn get_oracle_text(&self) -> &str
pub fn set_oracle_text(&mut self, oracle_text: String)
pub fn get_functional_variant_name(&self) -> Option<&str>
pub fn set_functional_variant_name( &mut self, functional_variant_name: Option<String>, )
pub fn get_flavor_name(&self) -> Option<&str>
pub fn set_flavor_name(&mut self, flavor_name: Option<String>)
pub fn get_base_power(&self) -> i32
pub fn set_base_power(&mut self, base_power: i32)
pub fn get_base_toughness(&self) -> i32
pub fn set_base_toughness(&mut self, base_toughness: i32)
pub fn get_base_power_string(&self) -> Option<&str>
pub fn get_base_toughness_string(&self) -> Option<&str>
pub fn set_base_power_string(&mut self, value: Option<String>)
pub fn set_base_toughness_string(&mut self, value: Option<String>)
pub fn get_base_loyalty(&self) -> &str
pub fn set_base_loyalty(&mut self, value: String)
pub fn get_base_defense(&self) -> &str
pub fn set_base_defense(&mut self, value: String)
pub fn get_attraction_lights(&self) -> Option<&HashSet<i32>>
pub fn set_attraction_lights(&mut self, attraction_lights: Option<HashSet<i32>>)
pub fn get_cached_keywords(&self) -> Vec<&KeywordInstanceData>
pub fn set_cached_keywords(&mut self, collection: KeywordCollection)
pub fn has_keyword_enum(&self, key: Keyword) -> bool
pub fn get_intrinsic_keywords(&self) -> Vec<&KeywordInstanceData>
pub fn has_intrinsic_keyword_state(&self, keyword: &str) -> bool
pub fn set_intrinsic_keywords( &mut self, _intrinsic_keywords: Vec<KeywordInterface>, _lki: bool, )
pub fn update_keywords_cache_for_state(&mut self)
pub fn add_intrinsic_keyword_with_init_traits( &mut self, keyword: String, _init_traits: bool, ) -> Option<KeywordInterface>
pub fn add_intrinsic_keywords_for_state( &mut self, keywords: Vec<String>, init_traits: bool, ) -> bool
pub fn remove_intrinsic_keyword_for_state(&mut self, keyword: &str) -> bool
pub fn get_spell_abilities(&self) -> FCollectionView<SpellAbility>
pub fn get_mana_abilities(&self) -> FCollectionView<SpellAbility>
pub fn get_non_mana_abilities(&self) -> FCollectionView<SpellAbility>
pub fn update_spell_abilities(&self, _new_col: &mut FCollection<SpellAbility>)
pub fn get_land_trait_changes(&self) -> &LandTraitChanges
pub fn get_intrinsic_spell_abilities(&self) -> Vec<SpellAbility>
pub fn get_first_ability(&self) -> Option<SpellAbility>
pub fn get_first_spell_ability(&self) -> Option<SpellAbility>
pub fn get_first_spell_ability_with_fallback(&self) -> Option<SpellAbility>
pub fn get_aura_spell(&self) -> Option<SpellAbility>
pub fn has_spell_ability_id(&self, id: i32) -> bool
pub fn add_spell_ability_state(&mut self, ability: SpellAbility) -> bool
pub fn get_triggers(&self) -> FCollectionView<Trigger>
pub fn has_trigger_id(&self, id: i32) -> bool
pub fn add_trigger_state(&mut self, trigger: Trigger) -> bool
pub fn get_static_abilities(&self) -> FCollectionView<StaticAbility>
pub fn add_static_ability_state( &mut self, static_ability: StaticAbility, ) -> bool
pub fn remove_static_ability_state( &mut self, _static_ability: StaticAbility, ) -> bool
pub fn get_replacement_effects(&self) -> FCollectionView<ReplacementEffect>
pub fn add_replacement_effect_state( &mut self, replacement_effect: ReplacementEffect, ) -> bool
pub fn has_replacement_effect_id(&self, id: i32) -> bool
pub fn get_replacement_effect(&self, id: i32) -> Option<ReplacementEffect>
pub fn get_foil(&self) -> i32
pub fn copy_from_state(&mut self, _source: &CardState, _lki: bool)
pub fn copy_from_with_trait_base( &mut self, _source: &CardState, _lki: bool, _ctb: &CardTraitBase, )
pub fn add_abilities_from_state(&mut self, _source: &CardState, _lki: bool)
pub fn copy(&self, host: Card, name: CardStateName, _lki: bool) -> CardState
pub fn get_rarity(&self) -> CardRarity
pub fn set_rarity(&mut self, rarity: CardRarity)
pub fn get_set_code(&self) -> &str
pub fn set_set_code(&mut self, set_code: String)
pub fn get_image_key(&self) -> &str
pub fn set_image_key(&mut self, image_key: String)
pub fn get_traits(&self) -> Vec<CardTraitBase>
pub fn reset_original_host(&mut self, _old_host: Card)
pub fn update_changed_text(&mut self)
pub fn change_text_intrinsic( &mut self, _color_map: HashMap<String, String>, _type_map: HashMap<String, String>, )
pub fn has_chapter(&self) -> bool
pub fn get_final_chapter_nr(&self) -> i32
pub fn get_manifest_up(&self) -> Option<SpellAbility>
pub fn get_cloak_up(&self) -> Option<SpellAbility>
pub fn get_ability_for_trigger(&self, svar: String) -> Option<SpellAbility>
Trait Implementations§
Source§impl GameObject for CardState
impl GameObject for CardState
fn is_valid_single( &self, restriction: &str, _source_controller: PlayerId, _source: &Card, _spell_ability: &CardTraitBase, ) -> bool
fn has_property( &self, property: &str, source_controller: PlayerId, _source: &Card, _spell_ability: &CardTraitBase, ) -> bool
fn can_be_targeted_by(&self, _sa: &SpellAbility) -> bool
fn is_valid( &self, restrictions: &[String], source_controller: PlayerId, source: &Card, spell_ability: &CardTraitBase, ) -> bool
Source§impl HasSVars for CardState
impl HasSVars for CardState
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
Source§impl ITranslatable for CardState
impl ITranslatable for CardState
fn get_translation_key(&self) -> String
fn get_untranslated_type(&self) -> String
fn get_translated_name(&self) -> String
Auto Trait Implementations§
impl !RefUnwindSafe for CardState
impl !UnwindSafe for CardState
impl Freeze for CardState
impl Send for CardState
impl Sync for CardState
impl Unpin for CardState
impl UnsafeUnpin for CardState
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.