From 34c1949525e711beaeb6465a54338ec3bd811712 Mon Sep 17 00:00:00 2001 From: stuebinm Date: Thu, 28 Oct 2021 23:15:55 +0200 Subject: 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. --- lib/Tiled2.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/Tiled2.hs') 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 -- cgit v1.2.3