-
Notifications
You must be signed in to change notification settings - Fork 34
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
Add WithAllParentMasters binary write builder option #547
Merged
Noggog
merged 2 commits into
Mutagen-Modding:dev
from
Elscrux:feature/WithAllParentMasters
Sep 7, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
Can we refactor this logic to an internal component that takes in the
LO
and returns theIEnumerable<ModKey>
?Once it's its own component, it'll be easier to test correctness, too, etc.
Main thing is that this builder call shouldn't be the one specifying the LO as an input parameter. The LO is set via other builder calls. Since not all the info is known at the time of THIS call, the logic written here should be run "lazily" at the end once all the bits are set and the Write is actually called
To get the "laziness", a system like the
_loadOrderSetter
will need to be added like a_mastersContentSetter
. When called during the "pull together" phase, it would pull in the LO set right before, and then use that to calculate the masters. I can do this part if you want, as it's pretty fiddly and error proneThere 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 looked at the
_loadOrderSetter
before, but the load order it has just has a limitedIModFlags
interface or so, which didn't allow master references to be looked at. I didn't want to edit the existing builder code so I went this way for now.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.
True true. hmm
Well. I think the idea is that load order is mainly used for ordering. Whereas the Data folder is used for looking up info about mods. So the presence of
ILoadOrderGetter<IModFlagsGetter> loadOrder
is maybe deceiving?I think someone like yourself using
WithAllParentMasters()
would:WithAllParentMasters()
call itselfWithDataFolder(...)
to let the system know where to read mods from to find all the parent mastersWithLoadOrder(...)
to let the system know how to order all the parent mastersMaybe as a followup, we could remove the
ILoadOrderGetter<IModFlagsGetter> loadOrder
, but I would want to deep dive on it to make sure that's a good cut.