-
Notifications
You must be signed in to change notification settings - Fork 127
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
SBN segment #1032
SBN segment #1032
Conversation
unk_3C: int | ||
|
||
def decode(self, data: bytes) -> int: | ||
self.signature, = struct.unpack(">4s", data[0x00:0x04]) |
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.
If we make this a dataclass, you can make a from_bytes that looks like
@staticmethod
def from_bytes(data: bytes) -> SBNHeader:
return SBNHeader(*struct.unpack(">4siiiiiiiiiiiiiiii"))
to avoid manually setting each specific field and calling unpack a bunch of times in a row
unk_14: bytes | ||
|
||
def decode(self, data: bytes) -> int: | ||
self.signature, = struct.unpack(">4s", data[0x00:0x04]) |
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 think here would be another good candidate for that
] | ||
|
||
def get_song_symbol_name(song_id: int) -> str: | ||
song_names = { |
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.
Shouldn't this be in a separate yaml file?
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.
yeah, probably... and separated by version. so like ver/us/song-names.yaml
Closing in favor of #1085 |
Resolves #866!