diff options
author | stuebinm | 2021-10-17 21:27:50 +0200 |
---|---|---|
committer | stuebinm | 2021-10-30 15:44:25 +0200 |
commit | a74cc87b085fa15213f8901f091db2631fee10db (patch) | |
tree | 333d8eb8d85e3e65d5410824fdc2a54f33e99957 /lib/Util.hs | |
parent | 216c2b6cfcef0038823f45c2bc43d297dcff43be (diff) |
add tileset property linting
this reorganised the whole linting for tilesets somewhat; it's now very
similar to that linting layers, and it may be possible to abstract some
of the code away ...
Diffstat (limited to '')
-rw-r--r-- | lib/Util.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Util.hs b/lib/Util.hs index 47ee7f2..18dfb5b 100644 --- a/lib/Util.hs +++ b/lib/Util.hs @@ -9,8 +9,8 @@ module Util where import Data.Aeson as Aeson import Data.Text (Text) import qualified Data.Text as T -import Tiled2 (Layer (layerData), PropertyValue (..), layerName, - mkTiledId) +import Tiled2 (Layer (layerData), PropertyValue (..), + Tileset (tilesetName), layerName, mkTiledId) -- | haskell's many string types are FUN … showText :: Show a => a -> Text @@ -43,6 +43,9 @@ instance PrettyPrint () where instance PrettyPrint Layer where prettyprint = (<>) "layer " . layerName +instance PrettyPrint Tileset where + prettyprint = (<>) "tileset " . tilesetName + printPretty :: PrettyPrint a => a -> IO () printPretty = putStr . T.unpack . prettyprint |