Skip to content

Instantly share code, notes, and snippets.

@arilotter
Forked from rust-play/playground.rs
Created October 10, 2019 21:12
Show Gist options
  • Save arilotter/47cde541d79a0a3d0267acae2fa6f5f8 to your computer and use it in GitHub Desktop.
Save arilotter/47cde541d79a0a3d0267acae2fa6f5f8 to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
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