Skip to content
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

Merged
merged 6 commits into from
Apr 30, 2023

Conversation

AustinHellerRepo
Copy link
Contributor

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.

@AustinHellerRepo AustinHellerRepo changed the title Editor refactor to use map_interface refactor: editor to use map_interface Apr 29, 2023
Copy link
Member

@zicklag zicklag left a 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;
@AustinHellerRepo
Copy link
Contributor Author

I've updated the struct name and centralized the macro. Please let me know if you would like any other changes. Thanks!

Copy link
Member

@zicklag zicklag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect!

@zicklag zicklag enabled auto-merge April 30, 2023 15:52
@zicklag zicklag added this pull request to the merge queue Apr 30, 2023
Merged via the queue into fishfolk:main with commit 2f53f07 Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants