bevy-add-events-macro

Crates.iobevy-add-events-macro
lib.rsbevy-add-events-macro
version0.1.0
sourcesrc
created_at2022-07-30 04:27:14.848414
updated_at2022-07-30 04:27:14.848414
descriptionA macro to add multiple events to a bevy app easily
homepage
repositoryhttps://git.tebibyte.media/nexus
max_upload_size
id635332
size2,134
Malek (MalekiRe)

documentation

README

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);
}
Commit count: 0

cargo fmt