pub struct StackEntry {
pub id: u32,
pub spell_ability: SpellAbility,
pub is_pending_cast: bool,
pub is_creature_spell: bool,
pub is_permanent_spell: bool,
pub cast_from_zone: Option<ZoneType>,
pub optional_trigger_decider: Option<PlayerId>,
pub optional_trigger_description: Option<String>,
pub optional_trigger_source_name: Option<String>,
}Expand description
An entry on the game stack (spell or ability waiting to resolve).
Mirrors Java’s SpellAbilityStackInstance which wraps a SpellAbility.
Fields§
§id: u32§spell_ability: SpellAbilityThe spell ability with its full sub-ability chain and targets.
is_pending_cast: boolTrue while a spell has been announced and moved to the stack, but its modes/targets/costs/payment have not finished yet. Pending entries are visible for casting prompts but must never resolve or receive priority.
is_creature_spell: boolWhether this is a creature spell (goes to battlefield on resolve).
is_permanent_spell: boolWhether this is a non-creature permanent spell.
cast_from_zone: Option<ZoneType>The zone the spell was cast from (for Flashback exile-on-resolve).
optional_trigger_decider: Option<PlayerId>If this is an optional trigger, the player who decides whether to
accept or decline. Mirrors Java’s WrappedAbility decider field.
optional_trigger_description: Option<String>Description text shown to the deciding player for optional triggers.
optional_trigger_source_name: Option<String>Source card name for optional trigger prompts.
Implementations§
Source§impl StackEntry
Extension methods on StackEntry mirroring Java’s SpellAbilityStackInstance.
These are implemented directly on StackEntry so callers can use them
without needing a separate wrapper.
impl StackEntry
Extension methods on StackEntry mirroring Java’s SpellAbilityStackInstance.
These are implemented directly on StackEntry so callers can use them
without needing a separate wrapper.
Sourcepub fn get_spell_ability(&self) -> &SpellAbility
pub fn get_spell_ability(&self) -> &SpellAbility
Get the underlying spell ability.
Mirrors Java’s SpellAbilityStackInstance.getSpellAbility().
Sourcepub fn get_source_card(&self) -> Option<CardId>
pub fn get_source_card(&self) -> Option<CardId>
Get the source card of this stack instance.
Mirrors Java’s SpellAbilityStackInstance.getSourceCard().
Sourcepub fn is_spell_instance(&self) -> bool
pub fn is_spell_instance(&self) -> bool
Whether this stack instance is a spell.
Mirrors Java’s SpellAbilityStackInstance.isSpell().
Sourcepub fn is_ability_instance(&self) -> bool
pub fn is_ability_instance(&self) -> bool
Whether this stack instance is an activated ability.
Mirrors Java’s SpellAbilityStackInstance.isAbility().
Sourcepub fn is_trigger_instance(&self) -> bool
pub fn is_trigger_instance(&self) -> bool
Whether this stack instance is a triggered ability.
Mirrors Java’s SpellAbilityStackInstance.isTrigger().
Sourcepub fn is_optional_trigger(&self) -> bool
pub fn is_optional_trigger(&self) -> bool
Whether this is an optional trigger (player may decline).
Mirrors Java’s SpellAbilityStackInstance.isOptionalTrigger().
Sourcepub fn get_stack_description(&self) -> String
pub fn get_stack_description(&self) -> String
Get the stack description for display.
Mirrors Java’s SpellAbilityStackInstance.getStackDescription().
Sourcepub fn get_activating_player(&self) -> PlayerId
pub fn get_activating_player(&self) -> PlayerId
Get the player who activated/cast this spell or ability.
Mirrors Java’s SpellAbilityStackInstance.getActivatingPlayer().
Sourcepub fn get_target_choices(&self) -> &TargetChoices
pub fn get_target_choices(&self) -> &TargetChoices
Get the target choices for the underlying spell ability.
Mirrors Java’s SpellAbilityStackInstance.getTargetChoices().
Source§impl StackEntry
impl StackEntry
Sourcepub fn next_id() -> u64
pub fn next_id() -> u64
Get the next unique ID for a stack entry.
Mirrors Java’s SpellAbilityStackInstance.nextId().
Sourcepub fn update_target(&mut self, old: CardId, new: CardId)
pub fn update_target(&mut self, old: CardId, new: CardId)
Update a target card in this stack entry’s spell ability.
Mirrors Java’s SpellAbilityStackInstance.updateTarget(Card, Card).
Sourcepub fn set_triggering_object<K: TriggerKeyInput>(&mut self, key: K, value: &str)
pub fn set_triggering_object<K: TriggerKeyInput>(&mut self, key: K, value: &str)
Set a triggering object on this stack entry’s spell ability.
Mirrors Java’s SpellAbilityStackInstance.setTriggeringObject(String, Object).
Sourcepub fn update_triggering_object<K: TriggerKeyInput>(
&mut self,
key: K,
value: &str,
)
pub fn update_triggering_object<K: TriggerKeyInput>( &mut self, key: K, value: &str, )
Update a triggering object in this stack entry’s spell ability.
Mirrors Java’s SpellAbilityStackInstance.updateTriggeringObject(String, Object).
Trait Implementations§
Source§impl Clone for StackEntry
impl Clone for StackEntry
Source§fn clone(&self) -> StackEntry
fn clone(&self) -> StackEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more