mirror of
https://github.com/OMGeeky/pytiled_parser.git
synced 2026-01-03 18:08:46 +01:00
Add type to wang sets
This commit is contained in:
@@ -30,6 +30,7 @@ class WangSet:
|
|||||||
|
|
||||||
name: str
|
name: str
|
||||||
tile: int
|
tile: int
|
||||||
|
wang_type: str
|
||||||
wang_tiles: List[WangTile]
|
wang_tiles: List[WangTile]
|
||||||
wang_colors: List[WangColor]
|
wang_colors: List[WangColor]
|
||||||
properties: Optional[properties_.Properties] = None
|
properties: Optional[properties_.Properties] = None
|
||||||
@@ -39,6 +40,8 @@ class RawWangTile(TypedDict):
|
|||||||
""" The keys and their types that appear in a Wang Tile JSON Object."""
|
""" The keys and their types that appear in a Wang Tile JSON Object."""
|
||||||
|
|
||||||
tileid: int
|
tileid: int
|
||||||
|
# Tiled stores these IDs as a list represented like so:
|
||||||
|
# [top, top_right, right, bottom_right, bottom, bottom_left, left, top_left]
|
||||||
wangid: List[int]
|
wangid: List[int]
|
||||||
|
|
||||||
|
|
||||||
@@ -59,6 +62,7 @@ class RawWangSet(TypedDict):
|
|||||||
name: str
|
name: str
|
||||||
properties: List[properties_.RawProperty]
|
properties: List[properties_.RawProperty]
|
||||||
tile: int
|
tile: int
|
||||||
|
type: str
|
||||||
wangtiles: List[RawWangTile]
|
wangtiles: List[RawWangTile]
|
||||||
|
|
||||||
|
|
||||||
@@ -117,6 +121,7 @@ def cast(raw_wangset: RawWangSet) -> WangSet:
|
|||||||
wangset = WangSet(
|
wangset = WangSet(
|
||||||
name=raw_wangset["name"],
|
name=raw_wangset["name"],
|
||||||
tile=raw_wangset["tile"],
|
tile=raw_wangset["tile"],
|
||||||
|
wang_type=raw_wangset["type"],
|
||||||
wang_colors=colors,
|
wang_colors=colors,
|
||||||
wang_tiles=tiles,
|
wang_tiles=tiles,
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user