-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[ecs] Entry
API for components and try_insert
command
#2418
Conversation
What is this doing differently compared to #2061? |
I think the name But I don't have any meaningful suggestion for better naming. |
Yep, I had this thought as well. |
|
for completion in IDE, it would be nice to start the name with |
Would we want something similar to the enum ComponentEntry {
Vacant(..),
Occupied(..),
}
world.entity_mut(e).component::<T>() |
i really like |
I have to admit though that having the word |
try_insert
for components.Entry
API for components.
The more I think about this, the more I don't think its a problem. Especially in the context of inserting something for an already valid entity, IMO, this is quite clear. I think the best example of
|
Entry
API for components.Entry
API for components and try_insert
command
Thanks a lot for your work! I can get behind this reasoning and the two other examples linked make a good case for it. I also don't think it changes the meaning of
We do lose out on IDE completion aid, but i guess it's an acceptable trade-off. |
This isn't quite true (at least as a VSCode/Rust Analyzer user. |
The It bothers me to use this word when neither the function name or the return type can explain why it could fail / if it failed |
Closing for now since there is probably a design discussion to be had to better this API |
Objective
Solution
component
function toEntityMut
try_insert
function toEntityCommands
.TODO: