-
Notifications
You must be signed in to change notification settings - Fork 699
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
Core: add specific can_reach helpers to CollectionState #2867
Core: add specific can_reach helpers to CollectionState #2867
Conversation
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.
Code LGTM.
My Outer Wilds apworld passes all tests when changed to use these helpers.
(unfortunately I can't meaningfully benchmark this because all of my remaining can_reach calls are in test code)
LGTM Pretty sure using those would (very slightly) improve performances of stardew rules. Unfortunately, I don't really have time to benchmark. |
So I ended up benchmarking the Stardew 5.x.x branch with these new helpers instead of the usual |
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.
I'm not happy with can_reach(..., "..."), so this change is welcome. Maybe we can even deprecate the old code one day and only allow a proper spot in can_reach.
What is this fixing or adding?
Adds specific can_reach helpers to CollectionState so that passing a string and strict string comparisons are no longer necessary. Should be marginally faster but didn't benchmark it.
How was this tested?
Used the new helper in my world and made sure it was still passing logic tests. Existing can_reach also calls into the new helpers so any tests with logic related to those also hits this.
If this makes graphical changes, please attach screenshots.