fishfolk / bones

An easy-to-use game engine for making real games.
https://fishfolk.org/development/bones/introduction/
Other
233 stars 20 forks source link

feat: add `SystemParam` derive macro #358

Closed nelson137 closed 7 months ago

nelson137 commented 7 months ago

Closes #16

Add a procedural derive macro to generate an impl SystemParam for structs.

Allows jumpy to replace this:

impl_system_param! {
    struct MySystemParam<'a> {
        commands: Commands<'a>,
        entities: ResMut<'a, Entities>,
    }
}

with this:

#[derive(SystemParam)]
struct MySystemParam<'a> {
    commands: Commands<'a>,
    entities: ResMut<'a, Entities>,
}