module Codec.Tiled.World.Map where

import Data.Aeson (FromJSON(..), ToJSON(..))
import GHC.Generics (Generic)

data Map = Map
  { Map -> FilePath
fileName :: FilePath
  , Map -> Int
x        :: Int -- ^ Global position X, in pixels
  , Map -> Int
y        :: Int -- ^ Global position Y, in pixels
  , Map -> Maybe Int
width    :: Maybe Int
  , Map -> Maybe Int
height   :: Maybe Int
  }
  deriving (Map -> Map -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Map -> Map -> Bool
$c/= :: Map -> Map -> Bool
== :: Map -> Map -> Bool
$c== :: Map -> Map -> Bool
Eq, Int -> Map -> ShowS
[Map] -> ShowS
Map -> FilePath
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [Map] -> ShowS
$cshowList :: [Map] -> ShowS
show :: Map -> FilePath
$cshow :: Map -> FilePath
showsPrec :: Int -> Map -> ShowS
$cshowsPrec :: Int -> Map -> ShowS
Show, forall x. Rep Map x -> Map
forall x. Map -> Rep Map x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Map x -> Map
$cfrom :: forall x. Map -> Rep Map x
Generic)

-- XXX: don't transform, fileName field
instance FromJSON Map
instance ToJSON Map