summaryrefslogtreecommitdiff
path: root/lib/Tiled2.hs
diff options
context:
space:
mode:
authorstuebinm2021-10-28 23:15:55 +0200
committerstuebinm2021-10-30 15:44:25 +0200
commit34c1949525e711beaeb6465a54338ec3bd811712 (patch)
tree2ff70ab49bdbeefcbbc36dfc82af73ab38c8c896 /lib/Tiled2.hs
parentd2983b867a106ee0581d8dc1d8f413178cdd4027 (diff)
flipping the output map structure
for now, just with layers. Instead of listing by layer (and giving lints multiple times), list by lint type (and list all layers in which this lint was applicable). This is a bit wonky for now, but readability of output is much better.
Diffstat (limited to '')
-rw-r--r--lib/Tiled2.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Tiled2.hs b/lib/Tiled2.hs
index 45b8ad0..3c881ec 100644
--- a/lib/Tiled2.hs
+++ b/lib/Tiled2.hs
@@ -1,10 +1,10 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE LambdaCase #-}
-{-# LANGUAGE OverloadedStrings #-}
-{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE NamedFieldPuns #-}
+{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE ScopedTypeVariables #-}
-- | This module provides Haskell types for Tiled's JSON exports, which you can
-- read about at http://doc.mapeditor.org/en/latest/reference/json-map-format/.
@@ -325,7 +325,10 @@ instance HasProperties Layer where
instance HasProperties Tileset where
getProperties = fromMaybe [] . tilesetProperties
-
+class HasName a where
+ getName :: a -> Text
+instance HasName Layer where
+ getName = layerName
data LoadResult = Loaded Tiledmap | IOErr String | DecodeErr String