mirror of
https://github.com/OMGeeky/pytiled_parser.git
synced 2025-12-26 17:02:28 +01:00
refactor(tiled_map): Renamed Map class to TiledMap
This commit is contained in:
@@ -5,5 +5,5 @@
|
||||
from .common_types import OrderedPair, Size
|
||||
from .layer import Layer
|
||||
from .properties import Properties
|
||||
from .tiled_map import Map
|
||||
from .tiled_map import TiledMap
|
||||
from .tileset import Tileset
|
||||
|
||||
@@ -18,7 +18,7 @@ TilesetDict = Dict[int, Tileset]
|
||||
|
||||
|
||||
@attr.s(auto_attribs=True)
|
||||
class Map:
|
||||
class TiledMap:
|
||||
"""Object for storing a TMX with all associated layers and properties.
|
||||
|
||||
See: https://doc.mapeditor.org/en/stable/reference/tmx-map-format/#map
|
||||
@@ -104,7 +104,7 @@ class _RawTiledMap(TypedDict):
|
||||
width: int
|
||||
|
||||
|
||||
def cast(file: Path) -> Map:
|
||||
def cast(file: Path) -> TiledMap:
|
||||
""" Cast the raw Tiled map into a pytiled_parser type
|
||||
|
||||
Args:
|
||||
@@ -137,7 +137,7 @@ def cast(file: Path) -> Map:
|
||||
tilesets[raw_tileset["firstgid"]] = tileset.cast(raw_tileset)
|
||||
|
||||
# `map` is a built-in function
|
||||
map_ = Map(
|
||||
map_ = TiledMap(
|
||||
infinite=raw_tiled_map["infinite"],
|
||||
layers=[layer.cast(layer_) for layer_ in raw_tiled_map["layers"]],
|
||||
map_size=Size(raw_tiled_map["width"], raw_tiled_map["height"]),
|
||||
|
||||
@@ -2,7 +2,7 @@ from pathlib import Path
|
||||
|
||||
from pytiled_parser import common_types, tiled_map, tileset
|
||||
|
||||
EXPECTED = tiled_map.Map(
|
||||
EXPECTED = tiled_map.TiledMap(
|
||||
infinite=False,
|
||||
layers=[],
|
||||
map_size=common_types.Size(8, 6),
|
||||
|
||||
@@ -2,7 +2,7 @@ from pathlib import Path
|
||||
|
||||
from pytiled_parser import common_types, layer, tiled_map, tileset
|
||||
|
||||
EXPECTED = tiled_map.Map(
|
||||
EXPECTED = tiled_map.TiledMap(
|
||||
hex_side_length=6,
|
||||
stagger_axis="y",
|
||||
stagger_index="odd",
|
||||
|
||||
@@ -2,7 +2,7 @@ from pathlib import Path
|
||||
|
||||
from pytiled_parser import common_types, tiled_map, tileset
|
||||
|
||||
EXPECTED = tiled_map.Map(
|
||||
EXPECTED = tiled_map.TiledMap(
|
||||
infinite=False,
|
||||
layers=[],
|
||||
map_size=common_types.Size(8, 6),
|
||||
|
||||
@@ -2,7 +2,7 @@ from pathlib import Path
|
||||
|
||||
from pytiled_parser import common_types, tiled_map, tileset
|
||||
|
||||
EXPECTED = tiled_map.Map(
|
||||
EXPECTED = tiled_map.TiledMap(
|
||||
infinite=False,
|
||||
layers=[],
|
||||
map_size=common_types.Size(8, 6),
|
||||
|
||||
Reference in New Issue
Block a user