From 968038c403e71b98a8f55a4d79e64beca8349ab3 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Mon, 20 Sep 2021 01:26:27 +0200 Subject: lint general map properties --- lib/Tiled2.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/Tiled2.hs') diff --git a/lib/Tiled2.hs b/lib/Tiled2.hs index 8220bfb..79033f0 100644 --- a/lib/Tiled2.hs +++ b/lib/Tiled2.hs @@ -398,7 +398,7 @@ data Tiledmap = Tiledmap { tiledmapVersion :: Float -- ^ Hex-formatted color (#RRGGBB or #AARRGGBB) (optional) , tiledmapRenderorder :: String -- ^ Rendering direction (orthogonal maps only) - , tiledmapProperties :: Map Text Text + , tiledmapProperties :: [Property] -- ^ String key-value pairs , tiledmapNextobjectid :: Int -- ^ Auto-increments for each placed object @@ -416,7 +416,7 @@ instance FromJSON Tiledmap where <*> o .: "tilesets" <*> (o .: "backgroundcolor" <|> pure Nothing) <*> o .: "renderorder" - <*> (o .: "properties" <|> pure mempty) + <*> (o .:? "properties" <&> fromMaybe []) <*> o .: "nextobjectid" parseJSON invalid = typeMismatch "Tiledmap" invalid -- cgit v1.2.3