Skip to content

hecs::Query should handle type parameters #359

@sanbox-irl

Description

@sanbox-irl

Basically I'd love this to work:

#[derive(hecs::Query)]
pub struct DrawSpriteQuery<'a, SpriteLike = Sprite> {
    pub transform: &'a Transform,
    pub sprite: &'a SpriteLike,
    pub shader_routine: &'a crate::gfx::ShaderRoutine,
    pub size: Option<&'a Size>,
}

I'll take a look in the macro to see how tough it would be, but I suspect not terribly difficult, but not sure!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions