Skip to content
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 to BMSBK #263

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Add classes to BMSBK #263

wants to merge 3 commits into from

Conversation

dyceron
Copy link
Contributor

@dyceron dyceron commented Jan 7, 2025

Now has classes with properties to better handle modifying block_groups

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.79%. Comparing base (b0de65a) to head (8eea51d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #263      +/-   ##
==========================================
+ Coverage   77.62%   77.79%   +0.16%     
==========================================
  Files          79       79              
  Lines        4027     4057      +30     
==========================================
+ Hits         3126     3156      +30     
  Misses        901      901              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@duncathan duncathan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add tests for the other properties to get full code coverage

tests/formats/test_bmsbk.py Show resolved Hide resolved
tests/formats/test_bmsbk.py Show resolved Hide resolved
tests/formats/test_bmsbk.py Outdated Show resolved Hide resolved
tests/formats/test_bmsbk.py Outdated Show resolved Hide resolved
@dyceron dyceron requested a review from duncathan January 14, 2025 04:57
construct.Terminated,
) # fmt: skip


class BlockType(Enum):
class BlockType(StrEnum):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StrEnum breaks python 3.10 - do class BlockType(str, Enum) instead

original_type = block_group.block_type
assert original_type == BlockType.POWER_BOMB
block_group.block_type = BlockType.BOMB
assert original_type != BlockType.BOMB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block_group = surface_bmsbk.get_block_group(0)
assert block_group.block_type is BlockType.POWER_BOMB
block_group.block_type = BlockType.BOMB
assert block_group.block_type is BlockType.BOMB

original_time = block.respawn_time
assert original_time == 0.0
block.respawn_time = 5.0
assert original_time != block.respawn_time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block = surface_bmsbk.get_block_group(0).get_block(0)
assert block.respawn_time == 0.0
block.respawn_time = 5.0
assert block.respawn_time == 5.0

assert block.model_name != "sg_casca80"

block.vignette_name = "sg_real_vignette"
assert block.vignette_name != ""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block = surface_bmsbk.get_block_group(0).get_block(0)

assert block.model_name == "sd_casca80"
block.model_name = "sg_real_model"
assert block.model_name == "sg_real_model"

assert block.vignette_name == ""
block.vignette_name = "sg_real_vignette"
assert block.vignette_name == "sg_real_vignette"

original_position = block.position
assert original_position == [-23100.0, 10700.0, 0.0]
block.position = [100.0, 200.0, 0.0]
assert original_position != block.position
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

block = surface_bmsbk.get_block_group(0).get_block(0)

assert block.position == [-23100.0, 10700.0, 0.0]
block.position = Vec3(100.0, 200.0, 0.0)
assert block.position == [100.0, 200.0, 0.0]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants