-
Notifications
You must be signed in to change notification settings - Fork 13
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
Shorthand for Singleton adding #184
Comments
@tynberry Singleton should be possible also note there's the DSL macro exactly for this reason: system!(
"processing_xxx_system",
world,
&mut ProcessingState ($), //singleton
&AsyncTaskSender,
)
``` |
@tynberry do you want to PR Singleton or should I add it to the backlog for myself? |
I might look at it but you can keep it on backlog. I know about the DSL macros, but from my experience of a low end computer user, rust analyzer does not work very well or at least as fast with them. I might look at them as well, but macros are still magic to me. |
@tynberry yeah RA with macro's don't work great until the macro is somewhat finished. |
the DSL macro mostly follows the convention from here https://www.flecs.dev/flecs/md_docs_2FlecsQueryLanguage.html but with some small differences (documented) |
When you want to add a singleton to query, you need to choose a term using
term_at
or filter usingwith
and then say it is a singleton.However it would be nice to have a simpler way to annotate singletons.
I propose two possible solutions, either add
with_singleton
andsingleton
that takes term index to merge the two calls or addSingleton<T>
generic struct which can take a component to mark as singleton, similar toOption<T>
marking as optional.The text was updated successfully, but these errors were encountered: