-
-
Notifications
You must be signed in to change notification settings - Fork 401
Renamed pool method typed_ref to try_get #846
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
Renamed pool method typed_ref to try_get #846
Conversation
…t trait bounds in pool and graph's typed_ref method.
…h try_get_node_mut
…h and SceneGraph traits; added use graph::prelude::* in the script template to expose try_get functionalities.
…ore/rename-pool-methods
…ose UserInterface's try_get functionality
Could you please fix the code generated by the project template generator? Check the CI for project template, it highlighted that there's an unused import there. The changes should be done in |
It is supposed to be unused before the user uses the try_get method from the Graph or UserInterface. Users are likely to call try_get in their scripts so I think the use is necessary. Maybe I can mark it as something like |
I think it is actually unused now with your changes. You can check it by generating a project with the project manager (compiled from the source code), if the removal of the import will allow the game build with no issues then you should definitely delete that in the project manager. |
I've added the |
Description
We need a uniform naming convention for the functionality of retrieving pool objects or their variants from the pool and the graph. Currently there are
typed_ref
,try_get_of_type
, etc. I think it is beneficial to unify them into the vanilla nametry_get
. For current occurrences oftry_get
for the Graph, I renamed it totry_get_node
. Specifying "node" for Graph is appropriate becauseGraph
usesNode
as the pool object type.I also added a prelude module for the fyrox_graph crate containing
AbstractSceneGraph
,BaseSceneGraph
andSceneGraph
, and addeduse fyrox::graph::prelude::*
in the script template so that functionalities like try_get are exposed by default.Related Issue(s)
Review Guidance
The code passed all auto tests.
Screenshots/GIFs
Checklist