Conversation
oli-obk
commented
Apr 16, 2025
| return; | ||
| fn move_system(world: &World, game_state: &mut GameState) { | ||
| if game_state.paused { | ||
| return; |
Contributor
Author
There was a problem hiding this comment.
This is the core part of this PR. it becomes much rarer that you need to use closures, though it's still very practical for things like textures that do not change and are only loaded once, as they can just be captured by immutable reference and do not have to be part of the mutable resource argument (here GameState).
Owner
There was a problem hiding this comment.
Soo much cleaner than passing around individual resources to each system.. Looks solid to me 😄
oli-obk
commented
Apr 16, 2025
|
|
||
| scheduler.register(|_world, state| { | ||
| *state += 1; | ||
| assert_eq!(immut_resource, "foo"); |
Contributor
Author
There was a problem hiding this comment.
here's an example of a system referring to something outside the system without capturing it
Owner
|
Yea I think that's a good solution for now.. Time will tell what needs to happen but it all looks great to me |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Best reviewed commit-by-commit
we keep the current scheduler to make transitioning easier. If we fully rip out the scheduler from the
World, that means we can actually remove theWorldargument of systems, and just capture the world in closures 😆 not sure that is too much tho. So let's first get a bit of a feel for this new system (pun intended).