Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support reflected event types for Observer triggers. #17511

Open
ItsDoot opened this issue Jan 23, 2025 · 0 comments
Open

Support reflected event types for Observer triggers. #17511

ItsDoot opened this issue Jan 23, 2025 · 0 comments
Labels
A-ECS Entities, components, systems, and events A-Reflection Runtime information about types C-Feature A new feature, making something new possible D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!

Comments

@ItsDoot
Copy link
Contributor

ItsDoot commented Jan 23, 2025

What problem does this solve or what need does it fill?

We don't currently support this as a safe alternative to #17509. Users might find this useful.

What solution would you like?

In a similar manner to #17509, we provide a ReflectedEvent event type for use in a Trigger:

fn my_observer(trigger: Trigger<ReflectedEvent>, /* ... */) {
    /* ... */
}

We would provide a type function to map ReflectedEvent into &dyn Reflect for Trigger::event() and &mut dyn Reflect for Trigger::event_mut().

@ItsDoot ItsDoot added A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! A-Reflection Runtime information about types labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events A-Reflection Runtime information about types C-Feature A new feature, making something new possible D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Projects
None yet
Development

No branches or pull requests

1 participant