diff --git a/pytiled_parser/tiled_object.py b/pytiled_parser/tiled_object.py index 4714ef2..ca74e6b 100644 --- a/pytiled_parser/tiled_object.py +++ b/pytiled_parser/tiled_object.py @@ -268,7 +268,9 @@ def _cast_point(raw_tiled_object: RawTiledObject) -> Point: def _cast_tile(raw_tiled_object: RawTiledObject) -> Tile: - raise NotImplementedError + gid = raw_tiled_object["gid"] + + return Tile(gid=gid, **_get_common_attributes(raw_tiled_object).__dict__) def _cast_polygon(raw_tiled_object: RawTiledObject) -> Polygon: diff --git a/tests/test_tiled_object.py b/tests/test_tiled_object.py index f0d5fda..a36636b 100644 --- a/tests/test_tiled_object.py +++ b/tests/test_tiled_object.py @@ -322,7 +322,7 @@ POINTS = [ ), ] -TILE_IMAGES = [ +TILES = [ ( """ { @@ -1053,7 +1053,7 @@ TEXTS = [ ), ] -OBJECTS = ELLIPSES + RECTANGLES + POINTS + TILE_IMAGES + POLYGONS + POLYLINES + TEXTS +OBJECTS = ELLIPSES + RECTANGLES + POINTS + TILES + POLYGONS + POLYLINES + TEXTS @pytest.mark.parametrize("raw_object_json,expected", OBJECTS)