Macro veloren_common::event_emitters

source ·
macro_rules! event_emitters {
    ($($vis:vis struct $read_data:ident[$emitters:ident] { $($ev_ident:ident: $ty:ty),+ $(,)? })+) => { ... };
}
Expand description

Define ecs read data for event busses. And a way to convert them all to emitters.

§Example:

mod some_mod_is_necessary_for_the_test {
    use veloren_common::event_emitters;
    pub struct Foo;
    pub struct Bar;
    pub struct Baz;
    event_emitters!(
      pub struct ReadEvents[EventEmitters] {
          foo: Foo, bar: Bar, baz: Baz,
      }
    );
}