Skip to main content

DelayedTrigger

Struct DelayedTrigger 

Source
pub struct DelayedTrigger {
Show 15 fields pub mode: TriggerType, pub trigger_mode: Box<dyn TriggerBehavior>, pub params: Params, pub execute_svar: String, pub controller: PlayerId, pub source_card: CardId, pub created_turn: u32, pub created_phase: PhaseType, pub target_card: Option<CardId>, pub remembered_amount: i32, pub remembered_cards: Vec<CardId>, pub remembered_players: Vec<PlayerId>, pub remembered_lki_cards: Vec<CardId>, pub sort_after_active: bool, pub trigger_order: Option<u32>,
}
Expand description

A one-shot delayed trigger.

Fields§

§mode: TriggerType§trigger_mode: Box<dyn TriggerBehavior>§params: Params§execute_svar: String§controller: PlayerId§source_card: CardId§created_turn: u32

Turn number when this delayed trigger was registered.

§created_phase: PhaseType

Phase during which this delayed trigger was registered.

§target_card: Option<CardId>

Optional target card for the delayed trigger (e.g. the creature to bounce for Dash or sacrifice for Blitz at end of turn).

§remembered_amount: i32

Sum of integer values remembered by the delayed trigger at creation.

§remembered_cards: Vec<CardId>

Cards remembered by the delayed trigger (e.g. RememberObjects$ Remembered copies the source card’s remembered_cards snapshot at registration time). Exposed to the executed ability via SpellAbility::trigger_remembered.

§remembered_players: Vec<PlayerId>

Players remembered by the delayed trigger (e.g. RememberObjects$ RememberedController snapshots the controllers of the source’s remembered cards at registration time, used by Arcane Denial’s “may draw up to two cards” trigger to remember the controller of the countered spell). Exposed via SpellAbility::trigger_remembered as AbilityValue::Player(_) entries.

§remembered_lki_cards: Vec<CardId>

Snapshot of remembered cards for delayed-trigger RememberedLKI lookups.

§sort_after_active: bool

When true, this delayed trigger should sort AFTER same-event active triggers (resolve FIRST on the LIFO stack). Used to mirror Java’s trigger-ID-based ordering for granted-evoke sacrifice triggers, whose trigger ID is assigned after the card’s intrinsic T: triggers and thus lands on top of the stack.

§trigger_order: Option<u32>

Java delayed triggers are real Trigger instances and receive a trigger id when parsed. Assign the equivalent order at registration so simultaneous delayed triggers do not tie on host timestamp.

Implementations§

Source§

impl DelayedTrigger

Source

pub fn as_trigger(&self, _game: &GameState) -> Trigger

Build a temporary Trigger wrapper for calling TriggerBehavior trait methods that require a &Trigger reference (Java’s this).

Trait Implementations§

Source§

impl Clone for DelayedTrigger

Source§

fn clone(&self) -> DelayedTrigger

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 DelayedTrigger

Source§

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

Formats the value using the given formatter. Read more

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