diff --git a/README.md b/README.md index 73274802..d577087b 100644 --- a/README.md +++ b/README.md @@ -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 | ✓ | ✓ | diff --git a/src/mercury_engine_data_structures/formats/__init__.py b/src/mercury_engine_data_structures/formats/__init__.py index 69a072fb..9d9bf96e 100644 --- a/src/mercury_engine_data_structures/formats/__init__.py +++ b/src/mercury_engine_data_structures/formats/__init__.py @@ -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 @@ -82,6 +83,8 @@ "BMSLINK": Bmslink, "BMSMD": Bmsmd, "BPSI": Bpsi, + "BPTDAT": Bptdat, + "BPTDEF": Bptdef, "BMTRE": Bmtre, "BNVIB": Bnvib, "BRSA": Brsa, diff --git a/src/mercury_engine_data_structures/formats/bptdat.py b/src/mercury_engine_data_structures/formats/bptdat.py new file mode 100644 index 00000000..7569b591 --- /dev/null +++ b/src/mercury_engine_data_structures/formats/bptdat.py @@ -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 diff --git a/tests/formats/test_bapd.py b/tests/formats/test_bapd.py index 5c91d7b1..0090ebb4 100644 --- a/tests/formats/test_bapd.py +++ b/tests/formats/test_bapd.py @@ -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) diff --git a/tests/formats/test_bnvib.py b/tests/formats/test_bnvib.py index 803152dc..3085091e 100644 --- a/tests/formats/test_bnvib.py +++ b/tests/formats/test_bnvib.py @@ -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) diff --git a/tests/formats/test_bpsi.py b/tests/formats/test_bpsi.py index 2facd042..5d7e6d62 100644 --- a/tests/formats/test_bpsi.py +++ b/tests/formats/test_bpsi.py @@ -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) diff --git a/tests/formats/test_bptdat.py b/tests/formats/test_bptdat.py new file mode 100644 index 00000000..cb428ab4 --- /dev/null +++ b/tests/formats/test_bptdat.py @@ -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)