Skip to content

Commit

Permalink
BPTDAT and BPTDEF
Browse files Browse the repository at this point in the history
- standard format
- fixed test names for some files (copy-paste moment)
  • Loading branch information
steven11sjf committed Jul 27, 2024
1 parent db2c05d commit 0a335fa
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ Construct type definitions for Mercury Engine
| BMTUN | ✓ | ✓ | Missing | Missing |
| BNVIB | Missing | Missing | ✓ | ✓ |
| BPSI | ✓ | ✓ | ✓ | ✓ |
| BPTDAT | Missing | Missing | ✗ | ✗ |
| BPTDEF | Missing | Missing | ✗ | ✗ |
| BPTDAT | Missing | Missing | ✓ | ✓ |
| BPTDEF | Missing | Missing | ✓ | ✓ |
| BREM | Missing | Missing | ✓ | ✓ |
| BRES | Missing | Missing | ✓ | ✓ |
| BREV | Missing | Missing | ✓ | ✓ |
Expand Down
3 changes: 3 additions & 0 deletions src/mercury_engine_data_structures/formats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
from mercury_engine_data_structures.formats.bmtun import Bmtun
from mercury_engine_data_structures.formats.bnvib import Bnvib
from mercury_engine_data_structures.formats.bpsi import Bpsi
from mercury_engine_data_structures.formats.bptdat import Bptdat, Bptdef
from mercury_engine_data_structures.formats.brem import Brem
from mercury_engine_data_structures.formats.bres import Bres
from mercury_engine_data_structures.formats.brev import Brev
Expand Down Expand Up @@ -82,6 +83,8 @@
"BMSLINK": Bmslink,
"BMSMD": Bmsmd,
"BPSI": Bpsi,
"BPTDAT": Bptdat,
"BPTDEF": Bptdef,
"BMTRE": Bmtre,
"BNVIB": Bnvib,
"BRSA": Brsa,
Expand Down
18 changes: 18 additions & 0 deletions src/mercury_engine_data_structures/formats/bptdat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import construct

from mercury_engine_data_structures.formats import standard_format
from mercury_engine_data_structures.formats.base_resource import BaseResource
from mercury_engine_data_structures.game_check import Game

BPTDAT = standard_format.create('CPlaythrough', "1.0.2")
BPTDEF = standard_format.create('CPlaythroughDef', "1.0.2")

class Bptdat(BaseResource):
@classmethod
def construct_class(cls, target_game: Game) -> construct.Construct:
return BPTDAT

class Bptdef(BaseResource):
@classmethod
def construct_class(cls, target_game: Game) -> construct.Construct:
return BPTDEF
2 changes: 1 addition & 1 deletion tests/formats/test_bapd.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@


@pytest.mark.parametrize("bapd_path", dread_data.all_files_ending_with(".bapd"))
def test_bmtre(dread_file_tree, bapd_path):
def test_bapd(dread_file_tree, bapd_path):
parse_build_compare_editor(Bapd, dread_file_tree, bapd_path)
2 changes: 1 addition & 1 deletion tests/formats/test_bnvib.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@


@pytest.mark.parametrize("bnvib_path", dread_data.all_files_ending_with(".bnvib"))
def test_bgsnds(dread_file_tree, bnvib_path):
def test_bnvib(dread_file_tree, bnvib_path):
parse_build_compare_editor(Bnvib, dread_file_tree, bnvib_path)
4 changes: 2 additions & 2 deletions tests/formats/test_bpsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@


@pytest.mark.parametrize("bpsi_path", dread_data.all_files_ending_with(".bpsi"))
def test_bmtre_dread(dread_file_tree, bpsi_path):
def test_bpsi_dread(dread_file_tree, bpsi_path):
parse_build_compare_editor(Bpsi, dread_file_tree, bpsi_path)

@pytest.mark.parametrize("bpsi_path", samus_returns_data.all_files_ending_with(".bpsi"))
def test_bmtre_sr(dread_file_tree, bpsi_path):
def test_bpsi_sr(dread_file_tree, bpsi_path):
parse_build_compare_editor(Bpsi, dread_file_tree, bpsi_path)
14 changes: 14 additions & 0 deletions tests/formats/test_bptdat.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import pytest
from tests.test_lib import parse_build_compare_editor

from mercury_engine_data_structures import dread_data
from mercury_engine_data_structures.formats.bptdat import Bptdat, Bptdef


@pytest.mark.parametrize("bptdat_path", dread_data.all_files_ending_with(".bptdat"))
def test_bptdat(dread_file_tree, bptdat_path):
parse_build_compare_editor(Bptdat, dread_file_tree, bptdat_path)

@pytest.mark.parametrize("bptdef_path", dread_data.all_files_ending_with(".bptdef"))
def test_bptdef(dread_file_tree, bptdef_path):
parse_build_compare_editor(Bptdef, dread_file_tree, bptdef_path)

0 comments on commit 0a335fa

Please sign in to comment.