Skip to main content

manabrew_engine/cost/
cost_part_with_trigger.rs

1//! Trigger hooks for parity with Java `CostPartWithTrigger`.
2
3use crate::ids::CardId;
4use crate::spellability::SpellAbility;
5
6#[derive(Debug, Clone, Default)]
7pub struct CostPartTriggerState {
8    pub paying_trigger_source: Option<CardId>,
9}
10
11pub fn set_trigger(state: &mut CostPartTriggerState, paying_trigger_source: Option<CardId>) {
12    state.paying_trigger_source = paying_trigger_source;
13}
14
15pub fn handle_before_payment(
16    _state: &CostPartTriggerState,
17    _ability: Option<&SpellAbility>,
18    _targets: &[CardId],
19) {
20    // Java builds and registers an immediate delayed trigger before payment.
21    // Rust trigger synthesis for paying triggers is handled by the game loop path.
22}