-
Notifications
You must be signed in to change notification settings - Fork 11
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 classes and functions to BMDEFS #266
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #266 +/- ##
==========================================
+ Coverage 77.62% 78.10% +0.47%
==========================================
Files 79 79
Lines 4027 4133 +106
==========================================
+ Hits 3126 3228 +102
- Misses 901 905 +4 ☔ View full report in Codecov by Sentry. |
|
||
@state_type.setter | ||
def state_type(self, value: str) -> None: | ||
self._raw.type = value |
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.
We could make the type an Enum instead of an arbitrary string, right? Because only DEATH
or COMBAT
should be accepted values.
return self._raw.priority | ||
|
||
@priority.setter | ||
def priority(self, value: str) -> None: |
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.
value: int
def environment_sfx_volume(self, value: float) -> None: | ||
self._raw.environment_sfx_volume = value | ||
|
||
# inner_states and start_delay are only used for enemies |
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.
Then make a seperate child class (something something named like EnemySounds
) inheriting from Sounds
which has these extra methods.
return self._raw.inner_states | ||
|
||
@inner_states.setter | ||
def inner_states(self, value: dict[str, float]) -> None: |
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.
The str
key in dict[str, float]
should be restricted to valid values (RELAX
and DEATH
only?). We can use an enum here, do we? (I'm tired and my brain starts to mix programming languages. Using something like dict[InnerStatEnum, float]
is doable but I don't know if it gets encoded properly without additional things)
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.
would just need to change the make_dict(Float32l)
to make_dict(Float32l, key_type=EnumAdapter(InnerStateEnum, StrId))
to decode/encode the way you'd like
Adds new classes for accessing sound properties