From 79f36a8f257bbbb05f3dc8e568dd87a0c651dcab Mon Sep 17 00:00:00 2001 From: Darren Eberly Date: Mon, 1 Jun 2020 21:36:26 -0400 Subject: [PATCH 1/2] fix: Changed RawTiledObject properties list to match casting requirements --- pytiled_parser/tiled_object.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pytiled_parser/tiled_object.py b/pytiled_parser/tiled_object.py index 7109350..78b1dcc 100644 --- a/pytiled_parser/tiled_object.py +++ b/pytiled_parser/tiled_object.py @@ -166,7 +166,7 @@ class RawTiledObject(TypedDict): visible: bool name: str type: str - properties: properties_.RawProperties + properties: List[properties_.RawProperties] template: Template ellipse: bool point: bool From b7c4b3ba7668842a1865cda152be72ddec242934 Mon Sep 17 00:00:00 2001 From: Darren Eberly Date: Mon, 1 Jun 2020 21:38:08 -0400 Subject: [PATCH 2/2] refactor: Removed templates as an attribute of TiledObjects --- pytiled_parser/tiled_object.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pytiled_parser/tiled_object.py b/pytiled_parser/tiled_object.py index 78b1dcc..f150693 100644 --- a/pytiled_parser/tiled_object.py +++ b/pytiled_parser/tiled_object.py @@ -7,7 +7,6 @@ from typing_extensions import TypedDict from . import properties as properties_ from .common_types import Color, OrderedPair, Size -from .template import Template @attr.s(auto_attribs=True, kw_only=True) @@ -29,7 +28,6 @@ class TiledObject: name: The name of the tiled object. type: The type of the tiled object. properties: The properties of the TiledObject. - template: A reference to a Template tiled object FIXME """ id: int @@ -44,7 +42,6 @@ class TiledObject: type: Optional[str] = None properties: properties_.Properties = {} - template: Optional[Template] = None @attr.s() @@ -167,7 +164,6 @@ class RawTiledObject(TypedDict): name: str type: str properties: List[properties_.RawProperties] - template: Template ellipse: bool point: bool polygon: List[Dict[str, float]] @@ -229,9 +225,6 @@ def _get_common_attributes(raw_tiled_object: RawTiledObject) -> TiledObject: if raw_tiled_object.get("properties"): common_attributes.properties = properties_.cast(raw_tiled_object["properties"]) - if raw_tiled_object.get("template"): - raise NotImplementedError - return common_attributes