-
-
Save arilotter/47cde541d79a0a3d0267acae2fa6f5f8 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct C120; | |
enum Zone { | |
Graveyard | |
} | |
struct MoveToZone { | |
to: Zone, | |
from: Zone | |
} | |
macro_rules! triggers { | |
(in $zone:expr => $phase:pat => $block:block) => { | |
stringify!(impl Trigger for C120 { | |
}) | |
} | |
} | |
fn main() { | |
let s = triggers! { | |
in Zone::Hand => MoveToZone { to: Zone::Graveyard, .. } => { | |
} | |
}; | |
println!("{:?}", s); | |
} | |
// fn trigger() -> TriggerStruct { | |
// TriggerStruct { | |
// run_after: |game, phase, my_id, _| { | |
// if let ResolvedPhase::Summon(id) = phase { | |
// if my_id == id { | |
// let owner = game.card(my_id).unwrap().owner; | |
// game.conjure_and_summon(enemy(owner), |c| c.cost == 1).await; | |
// } | |
// } | |
// }, | |
// } | |
// } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment