-
-
Notifications
You must be signed in to change notification settings - Fork 91
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
Add Query Unique #60
Comments
Thanks and that's actually a great idea! :) Im gonna take a look at how other ecs solve this problem, or if they actually solve it at all ^^ |
The idea of attaching components to the world is an unusual concept. To my knowledge, both Unity ECS and Svelto ECS are attached to entities. Do you want to view the world as a root entity? |
Mounting components on the world may produce another way that is independent of the current architecture. Perhaps we need a dictionary with component type as the key and entity as the value. This way, when we call QueryUnique, we can also determine if the component type is unique (singleton) to ensure that user actions do not produce unexpected results. |
That could work aswell. This could also be a bit optimized by avoiding the dictionary and replacing it with an array for faster access. Dictionarys normally have a small overhead, which is noticeable for large amounts of acess. |
I found that the bevy engine use resource for singleton component. the resource stored at spareset. |
We need a method to query singleton components. We will use this method in many scenarios, such as Player Input, making the code look more concise and readable.
The text was updated successfully, but these errors were encountered: