nexus/bevy-add-events-macro
malek aaa52f0c5f feat(add_events): added add_events macro, and some small networking events partially. 2022-07-29 21:27:04 -07:00
..
src feat(add_events): added add_events macro, and some small networking events partially. 2022-07-29 21:27:04 -07:00
Cargo.toml feat(add_events): added add_events macro, and some small networking events partially. 2022-07-29 21:27:04 -07:00
README.md feat(add_events): added add_events macro, and some small networking events partially. 2022-07-29 21:27:04 -07:00

README.md

This is a macro to add events. Given these events:

struct Event1;
struct Event2;
struct Event3;
struct Event4;
struct Event5;

This is the code you have to normally write in bevy

pub fn main() {
    let mut app = App::new();
    app.add_event::<Event1>();
    app.add_event::<Event2>();
    app.add_event::<Event3>();
    app.add_event::<Event4>();
    app.add_event::<Event5>();
   
}

And this is the code you can write with the add_events! macro!

pub fn main() {
    let mut app = App::new();
    add_events!(app, Event1, Event2, Event3, Event4, Event5);
}