summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Properties.hs16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/Properties.hs b/lib/Properties.hs
index 5845a1b..c9c704a 100644
--- a/lib/Properties.hs
+++ b/lib/Properties.hs
@@ -128,13 +128,27 @@ checkTileset = do
$ forbid "property \"tilesetCopyright\" for tilesets must be set."
-- check individual tileset properties
- mapM_ checkTilesetProperty (fromMaybe [] $ tilesetProperties tileset)
+ mapM_ checkTilesetProperty (fromMaybe mempty $ tilesetProperties tileset)
+
+ -- check individual tile definitions
+ mapM_ checkTile (fromMaybe mempty $ tilesetTiles tileset)
where
checkTilesetProperty :: Property -> LintWriter Tileset
checkTilesetProperty p@(Property name _value) = case name of
"copyright" -> naiveEscapeProperty p
_ -> warn $ "unknown tileset property " <> prettyprint name
+ checkTile :: Tile -> LintWriter Tileset
+ checkTile tile = do
+ -- TODO: refused doubled IDs?
+ mapM_ checkTileProperty (fromMaybe mempty $ tileProperties tile)
+ where checkTileProperty :: Property -> LintWriter Tileset
+ checkTileProperty p@(Property name _) = case name of
+ "collides" -> isBool p
+ _ -> warn $ "uknown tile property " <> prettyprint name
+ <> " in tile with global id "
+ <> showText (tileId tile)
+
-- | collect lints on a single map layer
checkLayer :: LintWriter Layer