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 tile type enum #92

Merged
merged 1 commit into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/mercury_engine_data_structures/formats/bmsmsd.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,19 @@
import functools

import construct
from construct.core import Const, Construct, Float32l, Hex, Int32sl, Int32ul, Struct
from construct.core import Const, Construct, Enum, Float32l, Hex, Int32sl, Int32ul, Struct

from mercury_engine_data_structures.common_types import CVector2D, CVector3D, StrId, make_vector
from mercury_engine_data_structures.formats import BaseResource
from mercury_engine_data_structures.game_check import Game

TileType = Enum(
Int32ul,
BLUE=1,
RED=2,
PURPLE=4
)

# BMSMSD
BMSMSD = Struct(
"_magic" / Const(b"MMSD"),
Expand All @@ -27,7 +34,7 @@
"top_right" / CVector2D,
),
"border_type" / Int32sl,
"tile_type" / Int32sl,
"tile_type" / TileType,
"icons" / make_vector(
Struct(
"actor_name" / StrId,
Expand Down
2 changes: 1 addition & 1 deletion tests/formats/test_bmsmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@


@pytest.mark.parametrize("bmsmsd_path", all_sr_bmsmsd)
def test_bmtun(samus_returns_tree, bmsmsd_path):
def test_bmsmsd(samus_returns_tree, bmsmsd_path):
parse_build_compare_editor(Bmsmsd, samus_returns_tree, bmsmsd_path)