summaryrefslogtreecommitdiff
path: root/lib/Tiled2.hs
diff options
context:
space:
mode:
authorstuebinm2021-09-20 01:26:27 +0200
committerstuebinm2021-09-20 01:26:27 +0200
commit968038c403e71b98a8f55a4d79e64beca8349ab3 (patch)
tree4a53190972b3f5a7c12a9a463856d7d4600fe75f /lib/Tiled2.hs
parent33d2b0c5da01c48c8106876665e646e1d2f560e9 (diff)
lint general map properties
Diffstat (limited to '')
-rw-r--r--lib/Tiled2.hs4
1 files changed, 2 insertions, 2 deletions
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