pub struct ManaPaymentContext {
pub is_spell: bool,
pub is_activated_ability: bool,
pub sa_on_stack: bool,
pub type_line: Option<CardTypeLine>,
pub card_name: Option<String>,
pub card_color: Option<ColorSet>,
pub chosen_types_by_source: HashMap<CardId, String>,
}Expand description
Context about what a mana payment is for, used to check restrictions.
Fields§
§is_spell: boolTrue if paying for a spell (not an ability).
is_activated_ability: boolTrue if paying for an activated ability’s cost. Distinct from
is_spell so triggered abilities and effect-driven costs (UnlessCost,
cumulative upkeep, …) are neither spell nor activated.
sa_on_stack: boolTrue when this is the actual payment phase for a spell already
announced on the stack — i.e. cast_spell.rs has already moved the
card to Stack and is now running auto-pay. Java parity: mirrors
AbilityManaPart.meetsManaRestrictions line 438 — if the SA we’re
paying for is currently on the stack, restricted mana sources whose
RestrictValid$ Spell (or similar) clause would otherwise apply are
rejected. This matches Forge’s behaviour where Leyline-Immersion-
style grants are effectively unusable for the cast they were
announced for, leaving only unrestricted producers in the pool.
Default is false so playability prediction stays optimistic.
type_line: Option<CardTypeLine>Card type line of the spell being cast OR the source of the activated
ability being paid for (for type checks like Activated.Elemental).
card_name: Option<String>Subtypes of the spell being cast.
card_color: Option<ColorSet>Color of the spell being cast (for Spell.Colorless-style qualifiers).
chosen_types_by_source: HashMap<CardId, String>Chosen creature/card types keyed by mana source card ID (e.g. Cavern of Souls).
Trait Implementations§
Source§impl Clone for ManaPaymentContext
impl Clone for ManaPaymentContext
Source§fn clone(&self) -> ManaPaymentContext
fn clone(&self) -> ManaPaymentContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more