|
| 1 | +from pathlib import Path |
| 2 | + |
| 3 | +from pytiled_parser import common_types, layer, tiled_map, tiled_object, tileset |
| 4 | + |
| 5 | +EXPECTED = tiled_map.TiledMap( |
| 6 | + infinite=False, |
| 7 | + layers=[ |
| 8 | + layer.ObjectLayer( |
| 9 | + name="Object Layer 1", |
| 10 | + opacity=1, |
| 11 | + visible=True, |
| 12 | + id=2, |
| 13 | + draw_order="topdown", |
| 14 | + tiled_objects=[ |
| 15 | + tiled_object.Rectangle( |
| 16 | + id=2, |
| 17 | + name="", |
| 18 | + rotation=0, |
| 19 | + size=common_types.Size(63.6585878103079, 38.2811778048473), |
| 20 | + coordinates=common_types.OrderedPair( |
| 21 | + 98.4987608686521, 46.2385012811358 |
| 22 | + ), |
| 23 | + visible=True, |
| 24 | + type="", |
| 25 | + ), |
| 26 | + tiled_object.Tile( |
| 27 | + id=3, |
| 28 | + coordinates=common_types.OrderedPair( |
| 29 | + 46.3682110303692, 112.993321292057 |
| 30 | + ), |
| 31 | + name="", |
| 32 | + rotation=0, |
| 33 | + type="", |
| 34 | + visible=True, |
| 35 | + size=common_types.Size(32, 32), |
| 36 | + gid=30, |
| 37 | + ), |
| 38 | + ], |
| 39 | + ) |
| 40 | + ], |
| 41 | + map_size=common_types.Size(8, 6), |
| 42 | + next_layer_id=3, |
| 43 | + next_object_id=4, |
| 44 | + orientation="orthogonal", |
| 45 | + render_order="right-down", |
| 46 | + tiled_version="1.6.0", |
| 47 | + tile_size=common_types.Size(32, 32), |
| 48 | + version="1.6", |
| 49 | + background_color=common_types.Color(255, 0, 4, 255), |
| 50 | + tilesets={ |
| 51 | + 1: tileset.Tileset( |
| 52 | + columns=8, |
| 53 | + image=Path(Path(__file__).parent / "../../images/tmw_desert_spacing.png") |
| 54 | + .absolute() |
| 55 | + .resolve(), |
| 56 | + image_width=265, |
| 57 | + image_height=199, |
| 58 | + margin=1, |
| 59 | + spacing=1, |
| 60 | + name="tile_set_image", |
| 61 | + tile_count=48, |
| 62 | + tiled_version="1.6.0", |
| 63 | + tile_height=32, |
| 64 | + tile_width=32, |
| 65 | + version="1.6", |
| 66 | + type="tileset", |
| 67 | + ) |
| 68 | + }, |
| 69 | + properties={ |
| 70 | + "bool property - true": True, |
| 71 | + "color property": common_types.Color(255, 73, 252, 255), |
| 72 | + "file property": Path("../../../../../../var/log/syslog"), |
| 73 | + "float property": 1.23456789, |
| 74 | + "int property": 13, |
| 75 | + "string property": "Hello, World!!", |
| 76 | + }, |
| 77 | +) |
0 commit comments