-
Notifications
You must be signed in to change notification settings - Fork 773
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: prepare worlds.Files for APWorldContainer #4331
base: main
Are you sure you want to change the base?
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.
looked at code and tested generate and patch a game
Co-authored-by: Doug Hoskisson <[email protected]>
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.
Did not test, but changes appear fine.
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 looks good, and successfully generated a Factorio
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.
APContainers is not a system I know very well, but code LGTM.
@@ -135,31 +126,58 @@ def read(self, file: Optional[Union[str, BinaryIO]] = None) -> None: | |||
message = f"{arg0} - " | |||
raise InvalidDataError(f"{message}This might be the incorrect world version for this file") from e | |||
|
|||
def read_contents(self, opened_zipfile: zipfile.ZipFile) -> None: | |||
def read_contents(self, opened_zipfile: zipfile.ZipFile) -> Dict[str, Any]: |
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.
This is something I didn't notice before.
related to #4516 (comment)
Not only is this ambiguous to both mutate and return something, this is also a breaking change.
If this base class returns something in this method, every subclass that overrides it also needs to return the same type.
That could include apworlds that are not in this repo, as well as some in this repo.
If this changes here, it needs to change in every subclass, and we need to think about the deprecation for external apworlds.
What is this fixing or adding?
Not much on its own.
APContainer is now just any AP related zip file containing an archipelago.json
APPlayerContainer is the old one, aimed at files for a particular slot/player
Follow up PR(s) can then cleanly introduce APWorldContainer(APContainer) with the meta data we desire inside the archipelago.json.
How was this tested?
I ran Factorio gen once and it didn't break