diff --git a/tests/test_data/tilesets/terrain/expected.py b/tests/test_data/tilesets/terrain/expected.py index c60195c..89051ae 100644 --- a/tests/test_data/tilesets/terrain/expected.py +++ b/tests/test_data/tilesets/terrain/expected.py @@ -17,7 +17,11 @@ EXPECTED = tileset.TileSet( version=1.2, type="tileset", terrain_types=[ - tileset.Terrain(name="Sand", tile=29), + tileset.Terrain( + name="Sand", + tile=29, + properties={"terrain property": "test terrain property"}, + ), tileset.Terrain(name="Cobblestone", tile=29), tileset.Terrain(name="Pavement", tile=29), tileset.Terrain(name="Dirt", tile=29), diff --git a/tests/test_data/tilesets/terrain/tileset.json b/tests/test_data/tilesets/terrain/tileset.json index a2b1667..4bd9d32 100644 --- a/tests/test_data/tilesets/terrain/tileset.json +++ b/tests/test_data/tilesets/terrain/tileset.json @@ -1,395 +1,206 @@ -{ - "columns": 8, - "image": "..\/..\/images\/tmw_desert_spacing.png", - "imageheight": 199, - "imagewidth": 265, - "margin": 1, - "name": "tileset", - "spacing": 1, - "terrains": [ - { - "name": "Sand", - "tile": 29 - }, - { - "name": "Cobblestone", - "tile": 29 - }, - { - "name": "Pavement", - "tile": 29 - }, - { - "name": "Dirt", - "tile": 29 - } - ], - "tilecount": 48, - "tiledversion": "1.3.5", - "tileheight": 32, - "tiles": [ - { - "id": 0, - "terrain": [ - 0, - 0, - 0, - 1 - ] - }, - { - "id": 1, - "terrain": [ - 0, - 0, - 1, - 1 - ] - }, - { - "id": 2, - "terrain": [ - 0, - 0, - 1, - 0 - ] - }, - { - "id": 3, - "terrain": [ - 3, - 3, - 3, - 0 - ] - }, - { - "id": 4, - "terrain": [ - 3, - 3, - 0, - 3 - ] - }, - { - "id": 5, - "terrain": [ - 0, - 0, - 0, - 3 - ] - }, - { - "id": 6, - "terrain": [ - 0, - 0, - 3, - 3 - ] - }, - { - "id": 7, - "terrain": [ - 0, - 0, - 3, - 0 - ] - }, - { - "id": 8, - "terrain": [ - 0, - 1, - 0, - 1 - ] - }, - { - "id": 9, - "terrain": [ - 1, - 1, - 1, - 1 - ] - }, - { - "id": 10, - "terrain": [ - 1, - 0, - 1, - 0 - ] - }, - { - "id": 11, - "terrain": [ - 3, - 0, - 3, - 3 - ] - }, - { - "id": 12, - "terrain": [ - 0, - 3, - 3, - 3 - ] - }, - { - "id": 13, - "terrain": [ - 0, - 3, - 0, - 3 - ] - }, - { - "id": 14, - "terrain": [ - 3, - 3, - 3, - 3 - ] - }, - { - "id": 15, - "terrain": [ - 3, - 0, - 3, - 0 - ] - }, - { - "id": 16, - "terrain": [ - 0, - 1, - 0, - 0 - ] - }, - { - "id": 17, - "terrain": [ - 1, - 1, - 0, - 0 - ] - }, - { - "id": 18, - "terrain": [ - 1, - 0, - 0, - 0 - ] - }, - { - "id": 19, - "terrain": [ - 1, - 1, - 1, - 0 - ] - }, - { - "id": 20, - "terrain": [ - 1, - 1, - 0, - 1 - ] - }, - { - "id": 21, - "terrain": [ - 0, - 3, - 0, - 0 - ] - }, - { - "id": 22, - "terrain": [ - 3, - 3, - 0, - 0 - ] - }, - { - "id": 23, - "terrain": [ - 3, - 0, - 0, - 0 - ] - }, - { - "id": 24, - "terrain": [ - 0, - 0, - 0, - 2 - ] - }, - { - "id": 25, - "terrain": [ - 0, - 0, - 2, - 2 - ] - }, - { - "id": 26, - "terrain": [ - 0, - 0, - 2, - 0 - ] - }, - { - "id": 27, - "terrain": [ - 1, - 0, - 1, - 1 - ] - }, - { - "id": 28, - "terrain": [ - 0, - 1, - 1, - 1 - ] - }, - { - "id": 29, - "terrain": [ - 0, - 0, - 0, - 0 - ] - }, - { - "id": 32, - "terrain": [ - 0, - 2, - 0, - 2 - ] - }, - { - "id": 33, - "terrain": [ - 2, - 2, - 2, - 2 - ] - }, - { - "id": 34, - "terrain": [ - 2, - 0, - 2, - 0 - ] - }, - { - "id": 35, - "terrain": [ - 2, - 2, - 2, - 0 - ] - }, - { - "id": 36, - "terrain": [ - 2, - 2, - 0, - 2 - ] - }, - { - "id": 40, - "terrain": [ - 0, - 2, - 0, - 0 - ] - }, - { - "id": 41, - "terrain": [ - 2, - 2, - 0, - 0 - ] - }, - { - "id": 42, - "terrain": [ - 2, - 0, - 0, - 0 - ] - }, - { - "id": 43, - "terrain": [ - 2, - 0, - 2, - 2 - ] - }, - { - "id": 44, - "terrain": [ - 0, - 2, - 2, - 2 - ] - } - ], - "tilewidth": 32, - "type": "tileset", - "version": 1.2 -} +{ "columns":8, + "editorsettings": + { + "export": + { + "format":"", + "target":"." + } + }, + "image":"..\/..\/images\/tmw_desert_spacing.png", + "imageheight":199, + "imagewidth":265, + "margin":1, + "name":"tileset", + "spacing":1, + "terrains":[ + { + "name":"Sand", + "properties":[ + { + "name":"terrain property", + "type":"string", + "value":"test terrain property" + }], + "tile":29 + }, + { + "name":"Cobblestone", + "tile":29 + }, + { + "name":"Pavement", + "tile":29 + }, + { + "name":"Dirt", + "tile":29 + }], + "tilecount":48, + "tiledversion":"1.3.5", + "tileheight":32, + "tiles":[ + { + "id":0, + "terrain":[0, 0, 0, 1] + }, + { + "id":1, + "terrain":[0, 0, 1, 1] + }, + { + "id":2, + "terrain":[0, 0, 1, 0] + }, + { + "id":3, + "terrain":[3, 3, 3, 0] + }, + { + "id":4, + "terrain":[3, 3, 0, 3] + }, + { + "id":5, + "terrain":[0, 0, 0, 3] + }, + { + "id":6, + "terrain":[0, 0, 3, 3] + }, + { + "id":7, + "terrain":[0, 0, 3, 0] + }, + { + "id":8, + "terrain":[0, 1, 0, 1] + }, + { + "id":9, + "terrain":[1, 1, 1, 1] + }, + { + "id":10, + "terrain":[1, 0, 1, 0] + }, + { + "id":11, + "terrain":[3, 0, 3, 3] + }, + { + "id":12, + "terrain":[0, 3, 3, 3] + }, + { + "id":13, + "terrain":[0, 3, 0, 3] + }, + { + "id":14, + "terrain":[3, 3, 3, 3] + }, + { + "id":15, + "terrain":[3, 0, 3, 0] + }, + { + "id":16, + "terrain":[0, 1, 0, 0] + }, + { + "id":17, + "terrain":[1, 1, 0, 0] + }, + { + "id":18, + "terrain":[1, 0, 0, 0] + }, + { + "id":19, + "terrain":[1, 1, 1, 0] + }, + { + "id":20, + "terrain":[1, 1, 0, 1] + }, + { + "id":21, + "terrain":[0, 3, 0, 0] + }, + { + "id":22, + "terrain":[3, 3, 0, 0] + }, + { + "id":23, + "terrain":[3, 0, 0, 0] + }, + { + "id":24, + "terrain":[0, 0, 0, 2] + }, + { + "id":25, + "terrain":[0, 0, 2, 2] + }, + { + "id":26, + "terrain":[0, 0, 2, 0] + }, + { + "id":27, + "terrain":[1, 0, 1, 1] + }, + { + "id":28, + "terrain":[0, 1, 1, 1] + }, + { + "id":29, + "terrain":[0, 0, 0, 0] + }, + { + "id":32, + "terrain":[0, 2, 0, 2] + }, + { + "id":33, + "terrain":[2, 2, 2, 2] + }, + { + "id":34, + "terrain":[2, 0, 2, 0] + }, + { + "id":35, + "terrain":[2, 2, 2, 0] + }, + { + "id":36, + "terrain":[2, 2, 0, 2] + }, + { + "id":40, + "terrain":[0, 2, 0, 0] + }, + { + "id":41, + "terrain":[2, 2, 0, 0] + }, + { + "id":42, + "terrain":[2, 0, 0, 0] + }, + { + "id":43, + "terrain":[2, 0, 2, 2] + }, + { + "id":44, + "terrain":[0, 2, 2, 2] + }], + "tilewidth":32, + "type":"tileset", + "version":1.2 +} \ No newline at end of file