#Query as a struct instead of a tuple

2 messages · Page 1 of 1 (latest)

merry dove
#

I have a query which get several components and I was wondering if there was a way to get them as a struct instead of a tuple. Right now I sometimes have to write something like this:

    let (
        _,
        _,
        _,
        _,
        skeleton_entity,
        _,
        home_location,
        _,
        _,
        _,
        transform_manager,
        _,
        mut active_model_actions,
    ) = model_action_params
        .combatants_query

But I'd rather write

    let MyQueryStruct {
        skeleton_entity,
        home_location,
        transform_manager,
        mut active_model_actions,
        ..
    } = model_action_params
        .combatants_query
sterile meteor