You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ItsDoot opened this issue
Aug 21, 2024
· 1 comment
Labels
A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleD-MacrosCode that generates Rust codeD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixes
What problem does this solve or what need does it fill?
Not all Event types can work well when targeted at an entity, or not targeted at an entity. This can end up surprising to users of these event types when they don't read the event's documentation about this, or if the documentation doesn't exist in the first place.
What solution would you like?
Allow Events to opt out of having a target or not having a target by providing two new subtraits:
That are automatically implemented by default for a given type when using #[derive(Event)], but can be opted out of via a macro attribute:
#[derive(Event)]#[event(untargeted = false)]// Opt out of untargeted, aka Commands::trigger#[event(targeted = false)]// Opt out of targeted, aka Commands::trigger_targetsstructMyEvent{}
Then, Commands/World/etc should have their related signatures updated to be:
Add documentation to all event types that are used with observers.
The text was updated successfully, but these errors were encountered:
ItsDoot
added
C-Feature
A new feature, making something new possible
A-ECS
Entities, components, systems, and events
D-Modest
A "normal" level of difficulty; suitable for simple features or challenging fixes
D-Macros
Code that generates Rust code
labels
Aug 21, 2024
A-ECSEntities, components, systems, and eventsC-FeatureA new feature, making something new possibleD-MacrosCode that generates Rust codeD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixes
What problem does this solve or what need does it fill?
Not all
Event
types can work well when targeted at an entity, or not targeted at an entity. This can end up surprising to users of these event types when they don't read the event's documentation about this, or if the documentation doesn't exist in the first place.What solution would you like?
Allow Events to opt out of having a target or not having a target by providing two new subtraits:
That are automatically implemented by default for a given type when using
#[derive(Event)]
, but can be opted out of via a macro attribute:Then,
Commands
/World
/etc should have their related signatures updated to be:What alternative(s) have you considered?
Add documentation to all event types that are used with observers.
The text was updated successfully, but these errors were encountered: