pub struct CardTraitBase { /* private fields */ }Implementations§
Source§impl CardTraitBase
impl CardTraitBase
pub fn set_id(&mut self, id: i32)
pub fn get_map_params(&self) -> &HashMap<String, String>
pub fn get_param_or_default<'a>( &'a self, key: &str, default: &'a str, ) -> &'a str
pub fn get_param(&self, key: &str) -> Option<&str>
pub fn get_original_param(&self, key: &str) -> Option<&str>
pub fn has_param(&self, key: &str) -> bool
pub fn put_param(&mut self, key: String, value: String) -> Option<String>
pub fn remove_param(&mut self, key: &str)
pub fn get_original_map_params(&self) -> &HashMap<String, String>
Sourcepub fn set_map_params(&mut self, params: HashMap<String, String>)
pub fn set_map_params(&mut self, params: HashMap<String, String>)
Initialize map_params and original_map_params from a source map.
Java sets these directly in each subclass constructor; Rust exposes a setter.
pub fn is_intrinsic(&self) -> bool
pub fn set_intrinsic(&mut self, i: bool)
pub fn host_card_id(&self) -> CardId
pub fn set_host_card_id(&mut self, id: CardId)
pub fn host_card<'a>(&self, game: &'a GameState) -> &'a Card
pub fn host_controller(&self, game: &GameState) -> PlayerId
pub fn is_keyword(&self, kw: Keyword) -> bool
pub fn get_keyword(&self) -> Option<&KeywordInterface>
pub fn set_keyword(&mut self, kw: KeywordInterface)
pub fn is_embalm(&self) -> bool
pub fn is_eternalize(&self) -> bool
pub fn is_secondary(&self) -> bool
pub fn is_class_ability(&self) -> bool
pub fn is_class_level_n_ability(&self, level: i32) -> bool
Sourcepub fn is_mana_ability(&self) -> bool
pub fn is_mana_ability(&self) -> bool
Overridden by SpellAbility. Base returns false.
Sourcepub fn matches_valid_with_player(
&self,
target: &MatchValidTarget<'_>,
valids: &[&str],
src_card: &Card,
src_player: PlayerId,
) -> bool
pub fn matches_valid_with_player( &self, target: &MatchValidTarget<'_>, valids: &[&str], src_card: &Card, src_player: PlayerId, ) -> bool
Resolution worker for Valid$ expressions with an explicit source
player. All CardTrait dispatch funnels through here; the trait
methods only decide which player to pass (see
CardTrait::resolve_source_player).
pub fn matches_compiled_valid_with_player( &self, target: &MatchValidTarget<'_>, selector: &CompiledSelector, src_card: &Card, src_player: PlayerId, ) -> bool
pub fn set_suppressed(&mut self, supp: bool)
pub fn is_suppressed(&self) -> bool
Sourcepub fn get_card_view(&self) -> !
pub fn get_card_view(&self) -> !
TODO(port): CardView / IHasCardView not ported.
pub fn get_svar_int(&self, name: &str) -> Option<i32>
Sourcepub fn get_all_svars(&self) -> HashMap<String, String>
pub fn get_all_svars(&self) -> HashMap<String, String>
Merged SVar map across keyword-static → self.
Local svars override fallbacks, matching Java getSVars() at line 613.
pub fn set_card_state(&mut self, state: &CardState)
pub fn get_card_state_name(&self) -> Option<CardStateName>
Sourcepub fn get_host_name<'a>(
&'a self,
game: &'a GameState,
node: &'a CardTraitBase,
) -> HostName<'a>
pub fn get_host_name<'a>( &'a self, game: &'a GameState, node: &'a CardTraitBase, ) -> HostName<'a>
Mirrors getHostName(CardTraitBase node).
Returns the alternate card-state view when the node is intrinsic and its state differs from the host’s current state; otherwise the host.
pub fn is_copied_trait(&self) -> bool
pub fn get_changed_text_colors(&self) -> HashMap<String, String>
pub fn get_changed_text_types(&self) -> HashMap<String, String>
Sourcepub fn changed_text_pairs(&self) -> Vec<(String, String)>
pub fn changed_text_pairs(&self) -> Vec<(String, String)>
Rust-only helper: flatten changed-text color + type maps into
(from, to) pairs. Consumed by SpellAbility::apply_text_changes to
push the same changes down into the trait’s overriding ability.
pub fn change_text_intrinsic( &mut self, color_map: HashMap<String, String>, type_map: HashMap<String, String>, )
pub fn change_text(&mut self)
pub fn copy_helper(&self, copy: &mut CardTraitBase, host: Card)
pub fn copy_helper_with_text( &self, copy: &mut CardTraitBase, host: Card, keep_text_changes: bool, )
Sourcepub fn get_trigger_remembered(&self) -> Vec<AbilityValue>
pub fn get_trigger_remembered(&self) -> Vec<AbilityValue>
Java dispatches on this instanceof SpellAbility / Trigger. In Rust
CardTraitBase is the concrete base; subclasses expose their own
get_trigger_remembered and should be called directly. Base returns
empty, matching Java’s final return ImmutableList.of().
Trait Implementations§
Source§impl CardTrait for CardTraitBase
impl CardTrait for CardTraitBase
Source§fn base(&self) -> &CardTraitBase
fn base(&self) -> &CardTraitBase
CardTraitBase. Implementors own a
CardTraitBase (directly or transitively) and return a reference.Source§fn resolve_source_player(&self, src_card: &Card) -> PlayerId
fn resolve_source_player(&self, src_card: &Card) -> PlayerId
Valid$ expressions.
Default matches Java’s base behavior (source card’s controller).
Trigger overrides — mirrors this instanceof Trigger in Java
CardTraitBase.matchesValid(Object, String[], Card) at line 214.Source§fn matches_valid(
&self,
target: &MatchValidTarget<'_>,
valids: &[&str],
src_card: Option<&Card>,
) -> bool
fn matches_valid( &self, target: &MatchValidTarget<'_>, valids: &[&str], src_card: Option<&Card>, ) -> bool
matchesValid(Object, String[], Card).fn matches_compiled_valid( &self, target: &MatchValidTarget<'_>, selector: &CompiledSelector, src_card: Option<&Card>, ) -> bool
fn matches_valid_param( &self, param: &str, target: &MatchValidTarget<'_>, src_card: Option<&Card>, ) -> bool
Source§fn matches_valid_card(&self, expr: &str, card: &Card, source: &Card) -> bool
fn matches_valid_card(&self, expr: &str, card: &Card, source: &Card) -> bool
matches_valid for
card targets. Mirrors Java’s matchesValid(Object, String[], Card)
call pattern where valids is often a single comma-separated string
(e.g. "Creature.YouCtrl,Artifact").fn matches_compiled_valid_card( &self, selector: &CompiledSelector, card: &Card, source: &Card, ) -> bool
Source§fn matches_valid_player(
&self,
expr: &str,
player: PlayerId,
source: &Card,
) -> bool
fn matches_valid_player( &self, expr: &str, player: PlayerId, source: &Card, ) -> bool
matches_valid for
player targets.