Skip to main content

RunParams

Struct RunParams 

Source
pub struct RunParams {
Show 83 fields pub card: Option<CardId>, pub card_lki: Option<CardId>, pub cards: Option<Vec<CardId>>, pub zone_changes: Option<Vec<ZoneChangeRecord>>, pub change_zone_table: Option<CardZoneTable>, pub origin: Option<ZoneType>, pub destination: Option<ZoneType>, pub destinations: Option<String>, pub activator: Option<PlayerId>, pub cause_player: Option<PlayerId>, pub player: Option<PlayerId>, pub phase: Option<PhaseType>, pub damage_source: Option<CardId>, pub damage_target_player: Option<PlayerId>, pub damage_target_card: Option<CardId>, pub target_player: Option<PlayerId>, pub target_card: Option<CardId>, pub damage_amount: Option<i32>, pub is_combat_damage: Option<bool>, pub first_time: Option<bool>, pub fizzle: Option<bool>, pub valiant: Option<bool>, pub attacker: Option<CardId>, pub attacked_player: Option<PlayerId>, pub attacked_card: Option<CardId>, pub other_attacker_ids: Option<Vec<CardId>>, pub defenders_player_ids: Option<Vec<PlayerId>>, pub defenders_card_ids: Option<Vec<CardId>>, pub attacking_player: Option<PlayerId>, pub defending_player: Option<PlayerId>, pub spell_card: Option<CardId>, pub spell_controller: Option<PlayerId>, pub card2: Option<CardId>, pub explored: Option<CardId>, pub spell_ability: Option<SpellAbility>, pub source_sa: Option<SpellAbility>, pub ability_mana: Option<SpellAbility>, pub cause: Option<SpellAbility>, pub causer: Option<CardId>, pub produced: Option<String>, pub mode: Option<String>, pub num: Option<i32>, pub number: Option<i32>, pub blocker: Option<CardId>, pub blocked_attacker: Option<CardId>, pub life_amount: Option<i32>, pub counter_type: Option<String>, pub counter_amount: Option<i32>, pub attacker_ids: Option<Vec<CardId>>, pub blocker_ids: Option<Vec<CardId>>, pub original_controller: Option<PlayerId>, pub mana_expend_amount: Option<i32>, pub enlisted: Option<CardId>, pub cause_card: Option<CardId>, pub coin_flip_won: Option<bool>, pub die_result: Option<i32>, pub die_results: Option<Vec<i32>>, pub natural_result: Option<i32>, pub die_sides: Option<i32>, pub num_attackers: Option<usize>, pub exploited_card: Option<CardId>, pub lki_p1p1_counters: Option<i32>, pub lki_power: Option<i32>, pub lki_toughness: Option<i32>, pub cumulative_upkeep_paid: Option<bool>, pub echo_paid: Option<bool>, pub class_level: Option<i32>, pub room_name: Option<String>, pub crew_cards: Option<Vec<CardId>>, pub championed_card: Option<CardId>, pub source_card: Option<CardId>, pub source_player: Option<PlayerId>, pub object_card: Option<CardId>, pub object_player: Option<PlayerId>, pub counter_map: Option<BTreeMap<String, i32>>, pub damage_map: Option<CardDamageMap>, pub clash_won: Option<bool>, pub card_state_name: Option<String>, pub drawn_this_turn_snapshot: Option<i32>, pub first_time_players: Option<Vec<PlayerId>>, pub all_votes: Option<Vec<(String, Vec<PlayerId>)>>, pub discarded_before: Option<Vec<CardId>>, pub rolled_to_visit_attractions: Option<bool>,
}
Expand description

Typed event parameter keys — mirrors Java AbilityKey enum. In Java this is Map<AbilityKey, Object>. In Rust we use a struct because Rust has no Object type (justified deviation).

Fields§

§card: Option<CardId>§card_lki: Option<CardId>§cards: Option<Vec<CardId>>

Additional card collection payload used by many Java triggers (AbilityKey.Cards).

§zone_changes: Option<Vec<ZoneChangeRecord>>

Batched zone-change payload used by Java’s CardZoneTable triggers.

§change_zone_table: Option<CardZoneTable>

Java-style CardZoneTable object payload for batch zone-change triggers.

§origin: Option<ZoneType>§destination: Option<ZoneType>§destinations: Option<String>

CSV destination payload used by TriggerAbilityTriggered for batch triggers.

§activator: Option<PlayerId>

Java AbilityKey.Activator.

§cause_player: Option<PlayerId>§player: Option<PlayerId>§phase: Option<PhaseType>§damage_source: Option<CardId>§damage_target_player: Option<PlayerId>§damage_target_card: Option<CardId>§target_player: Option<PlayerId>

Java AbilityKey.Target payload split by target type.

§target_card: Option<CardId>§damage_amount: Option<i32>§is_combat_damage: Option<bool>§first_time: Option<bool>

Java AbilityKey.FirstTime marker.

§fizzle: Option<bool>

Java AbilityKey.Fizzle marker.

§valiant: Option<bool>

Java AbilityKey.Valiant marker.

§attacker: Option<CardId>§attacked_player: Option<PlayerId>

Java AbilityKey.Attacked split by entity type.

§attacked_card: Option<CardId>§other_attacker_ids: Option<Vec<CardId>>

Java AbilityKey.OtherAttackers.

§defenders_player_ids: Option<Vec<PlayerId>>

Java AbilityKey.Defenders split by entity type.

§defenders_card_ids: Option<Vec<CardId>>§attacking_player: Option<PlayerId>

Java AbilityKey.AttackingPlayer.

§defending_player: Option<PlayerId>§spell_card: Option<CardId>§spell_controller: Option<PlayerId>§card2: Option<CardId>

Second card involved (e.g. second creature in a Fight trigger).

§explored: Option<CardId>

Java AbilityKey.Explored.

§spell_ability: Option<SpellAbility>

SpellAbility that was countered

§source_sa: Option<SpellAbility>

Java AbilityKey.SourceSA.

§ability_mana: Option<SpellAbility>

Java AbilityKey.AbilityMana.

§cause: Option<SpellAbility>

Cause of the event (e.g. counterspell)

§causer: Option<CardId>

Java AbilityKey.Causer payload.

§produced: Option<String>

Java AbilityKey.Produced.

§mode: Option<String>

Java AbilityKey.Mode.

§num: Option<i32>

Java AbilityKey.Num.

§number: Option<i32>

Java AbilityKey.Number.

§blocker: Option<CardId>

Blocking creature (for Blocks trigger).

§blocked_attacker: Option<CardId>

Attacker being blocked (for Blocks trigger).

§life_amount: Option<i32>

Life amount gained or lost (for LifeGained/LifeLost triggers).

§counter_type: Option<String>

Counter type name (for CounterAdded/CounterRemoved triggers).

§counter_amount: Option<i32>

Number of counters added/removed.

§attacker_ids: Option<Vec<CardId>>

Batch of attacker IDs (for AttackersDeclared).

§blocker_ids: Option<Vec<CardId>>

Batch of blocker IDs (for BlockersDeclared).

§original_controller: Option<PlayerId>

Original controller before a control change.

§mana_expend_amount: Option<i32>

Cumulative mana expend amount (for ManaExpend trigger).

§enlisted: Option<CardId>

Enlisted card (for TriggerType::Enlisted).

§cause_card: Option<CardId>

The spell/ability card that caused the event (for BecomesTarget — the targeting spell).

§coin_flip_won: Option<bool>

Coin-flip outcome (true = win/heads).

§die_result: Option<i32>

Rolled die result (modified).

§die_results: Option<Vec<i32>>

Batch of rolled die results (for RolledDieOnce aggregate triggers).

§natural_result: Option<i32>

Rolled die natural result before modifiers.

§die_sides: Option<i32>

Number of sides on the rolled die.

§num_attackers: Option<usize>

Number of attackers declared this combat (for Exalted Alone$ True check).

§exploited_card: Option<CardId>

The creature that was exploited (for Exploited trigger).

§lki_p1p1_counters: Option<i32>

LKI +1/+1 counter count on a card that just left the battlefield. Used by Modular triggers to know how many counters to move.

§lki_power: Option<i32>

LKI power on a card that just left the battlefield. Used for TriggeredCard$CardPower without depending on mutable card state.

§lki_toughness: Option<i32>

LKI toughness on a card that just left the battlefield. Used for TriggeredCard$CardToughness without depending on mutable card state.

§cumulative_upkeep_paid: Option<bool>

Whether cumulative upkeep was paid (for PayCumulativeUpkeep trigger).

§echo_paid: Option<bool>

Whether echo was paid (for PayEcho trigger).

§class_level: Option<i32>

Gained class level value.

§room_name: Option<String>

Room name payload for room-enter triggers.

§crew_cards: Option<Vec<CardId>>

Cards that crewed/saddled another card.

§championed_card: Option<CardId>

Championed card payload.

§source_card: Option<CardId>

Generic source card payload for triggers like Mentored.

§source_player: Option<PlayerId>

Generic source player payload for triggers like CounterPlayerAddedAll.

§object_card: Option<CardId>

Generic object card payload for triggers like CounterTypeAddedAll.

§object_player: Option<PlayerId>

Generic object player payload for triggers like CounterTypeAddedAll.

§counter_map: Option<BTreeMap<String, i32>>

Counter type -> amount map payload.

§damage_map: Option<CardDamageMap>

Java AbilityKey.DamageMap.

§clash_won: Option<bool>

Clash outcome.

§card_state_name: Option<String>

Card state name payload (for door/room state specific checks).

§drawn_this_turn_snapshot: Option<i32>

Snapshot of drawn_this_turn at the time a Drawn event fires. Used by Number$ N triggers to compare against the exact draw count at fire time (not at deferred match time).

§first_time_players: Option<Vec<PlayerId>>

Players for whom this was the first relevant event this turn.

§all_votes: Option<Vec<(String, Vec<PlayerId>)>>

Java AbilityKey.AllVotes.

§discarded_before: Option<Vec<CardId>>

Java AbilityKey.DiscardedBefore.

§rolled_to_visit_attractions: Option<bool>

Java AbilityKey.RolledToVisitAttractions.

Implementations§

Source§

impl RunParams

Source

pub fn add_common_trigger_objects(&self, sa: &mut SpellAbility)

Source

pub fn get_value(&self, key: AbilityKey) -> Option<AbilityValue>

Source

pub fn as_ability_map(&self) -> HashMap<AbilityKey, AbilityValue>

Source

pub fn get(&self, key: AbilityKey) -> Option<AbilityValue>

Java-parity alias for Map<AbilityKey, Object>.get(...).

Source

pub fn get_card(&self, key: AbilityKey) -> Option<CardId>

Get a card ID from run-params by AbilityKey. Provides a generic accessor so code can use AbilityKey enum values to pull data from the typed struct.

Source

pub fn get_player(&self, key: AbilityKey) -> Option<PlayerId>

Get a player ID from run-params by AbilityKey.

Source

pub fn get_amount(&self, key: AbilityKey) -> Option<i32>

Get an integer amount from run-params by AbilityKey.

Source

pub fn get_bool(&self, key: AbilityKey) -> Option<bool>

Get a bool marker by AbilityKey.

Source

pub fn get_spell_ability(&self, key: AbilityKey) -> Option<&SpellAbility>

Get a SpellAbility by AbilityKey.

Source

pub fn get_cards(&self, key: AbilityKey) -> Option<&[CardId]>

Get a card list by AbilityKey.

Source

pub fn get_string(&self, key: AbilityKey) -> Option<&str>

Get a string payload by AbilityKey.

Trait Implementations§

Source§

impl Clone for RunParams

Source§

fn clone(&self) -> RunParams

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 RunParams

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for RunParams

Source§

fn default() -> RunParams

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for RunParams

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for RunParams

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> Serialize for T
where T: Serialize + ?Sized,

Source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

Source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

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