diff --git a/tests/test_data/layer_tests/all_layer_types/expected.py b/tests/test_data/layer_tests/all_layer_types/expected.py index 6643112..9e27994 100644 --- a/tests/test_data/layer_tests/all_layer_types/expected.py +++ b/tests/test_data/layer_tests/all_layer_types/expected.py @@ -1,3 +1,97 @@ -from pytiled_parser import common_types, layer +from pathlib import Path -EXPECTED = [layer.TileLayer(name="Tile Layer 1", opacity=1, visible=True)] +from pytiled_parser import common_types, layer, tiled_object + +EXPECTED = [ + layer.TileLayer( + name="Tile Layer 1", + opacity=1, + visible=True, + id=1, + size=common_types.Size(8, 6), + data=[ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + ], + ), + layer.LayerGroup( + name="Group 1", + opacity=1, + visible=True, + id=4, + layers=[ + layer.ObjectLayer( + name="Object Layer 1", + opacity=1, + visible=True, + id=2, + draw_order="topdown", + tiled_objects=[ + tiled_object.Rectangle( + id=1, + name="", + rotation=0, + size=common_types.Size(69.3333333333333, 52.6666666666667), + coordinates=common_types.OrderedPair(46.3333333333333, 39), + visible=True, + type="", + ) + ], + ), + ], + ), + layer.ImageLayer( + name="Image Layer 1", + opacity=1, + visible=True, + id=3, + image=Path("../../images/tile_04.png"), + transparent_color=common_types.Color("#000000"), + ), +] diff --git a/tests/test_data/layer_tests/all_layer_types/map.json b/tests/test_data/layer_tests/all_layer_types/map.json index 6aa83c4..9ea084c 100644 --- a/tests/test_data/layer_tests/all_layer_types/map.json +++ b/tests/test_data/layer_tests/all_layer_types/map.json @@ -1,4 +1,11 @@ { "compressionlevel":-1, + "editorsettings": + { + "export": + { + "target":"." + } + }, "height":6, "infinite":false, "layers":[ @@ -14,42 +21,54 @@ "x":0, "y":0 }, - { - "draworder":"topdown", - "id":2, - "name":"Object Layer 1", - "objects":[], - "opacity":1, - "type":"objectgroup", - "visible":true, - "x":0, - "y":0 - }, - { - "id":3, - "image":"", - "name":"Image Layer 1", - "opacity":1, - "type":"imagelayer", - "visible":true, - "x":0, - "y":0 - }, { "id":4, - "layers":[], + "layers":[ + { + "draworder":"topdown", + "id":2, + "name":"Object Layer 1", + "objects":[ + { + "height":52.6666666666667, + "id":1, + "name":"", + "rotation":0, + "type":"", + "visible":true, + "width":69.3333333333333, + "x":46.3333333333333, + "y":39 + }], + "opacity":1, + "type":"objectgroup", + "visible":true, + "x":0, + "y":0 + }], "name":"Group 1", "opacity":1, "type":"group", "visible":true, "x":0, "y":0 + }, + { + "id":3, + "image":"..\/..\/images\/tile_04.png", + "name":"Image Layer 1", + "opacity":1, + "transparentcolor":"#000000", + "type":"imagelayer", + "visible":true, + "x":0, + "y":0 }], "nextlayerid":5, - "nextobjectid":1, + "nextobjectid":3, "orientation":"orthogonal", "renderorder":"right-down", - "tiledversion":"1.3.1", + "tiledversion":"1.4.1", "tileheight":32, "tilesets":[ { @@ -58,6 +77,6 @@ }], "tilewidth":32, "type":"map", - "version":1.2, + "version":1.4, "width":8 } \ No newline at end of file