-
Notifications
You must be signed in to change notification settings - Fork 117
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
refactor: editor to use map_interface #771
Conversation
…ion; need to test;
…nto editor_refactor
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, looking great, thanks!
Regarding the name, I think I like MapManger
, which also has a slight precendent in Jumpy with the SessionManager
existing already.
Unless you don't like that name, I'm not super picky. :D
Regarding the macro, could you move it to core/src/utils.rs
( or maybe core/src/utils/macros.rs
if you think that seems appropriate ), and then in core/src/lib.rs
we can add a #[macro_use]
import for utils
so that we can use the macro throughout the crate.
Then we can also remove macro definition from collisions.rs
.
…_system_param macro; updated collision.rs to use centralized macro;
I've updated the struct name and centralized the macro. Please let me know if you would like any other changes. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!
The player interactions handled by the editor.rs file have been refactored out into a separate struct so that future enhancements to the editor may use this refactored code instead of copying large sections of it if similar functionality is used (and will be used as part of my next update to allow for map randomization).
An example of how this refactoring will help is when large parts of the map will be updated with one button click. Now simply calling map_interface.set_tile multiple times is possible instead of copy-pasting all of the code previously contained in the SetTile match-case.