Created
October 10, 2019 21:12
-
-
Save rust-play/6b56bb8c88105068fe4a8aa8646cdaec to your computer and use it in GitHub Desktop.
Code shared from the Rust Playground
This file contains hidden or 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