Skip to content

Commit

Permalink
Add new function to bmsmsd to get a tile by index
Browse files Browse the repository at this point in the history
  • Loading branch information
dyceron committed Dec 15, 2024
1 parent 0ccea36 commit 3dcae8c
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/mercury_engine_data_structures/formats/bmsmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,26 @@
from typing import TYPE_CHECKING

import construct
from construct.core import Const, Construct, Enum, FlagsEnum, Float32l, Int32sl, Int32ul, Struct
from construct.core import (
Const,
Construct,
Container,
Enum,
FlagsEnum,
Float32l,
Int32sl,
Int32ul,
Struct,
)

from mercury_engine_data_structures.base_resource import BaseResource
from mercury_engine_data_structures.common_types import CVector2D, CVector3D, StrId, VersionAdapter, make_vector
from mercury_engine_data_structures.common_types import (
CVector2D,
CVector3D,
StrId,
VersionAdapter,
make_vector,
)

if TYPE_CHECKING:
from mercury_engine_data_structures.game_check import Game
Expand Down Expand Up @@ -85,3 +101,6 @@ class Bmsmsd(BaseResource):
@functools.lru_cache
def construct_class(cls, target_game: Game) -> Construct:
return BMSMSD

def get_tile(self, tile_idx: int) -> Container:
return self.raw.tiles[tile_idx]

Check warning on line 106 in src/mercury_engine_data_structures/formats/bmsmsd.py

View check run for this annotation

Codecov / codecov/patch

src/mercury_engine_data_structures/formats/bmsmsd.py#L106

Added line #L106 was not covered by tests

0 comments on commit 3dcae8c

Please sign in to comment.