module Codec.Tiled.Map where
import Codec.Tiled.Aeson (FromJSON(..), ToJSON(..), genericParseJSON, genericToJSON)
import Data.Text (Text)
import Data.Vector (Vector)
import GHC.Generics (Generic)
import Codec.Tiled.Layer (Layer)
import Codec.Tiled.Property (Property)
import Codec.Tiled.Tileset.Ref (TilesetRef)
data Map = Map
{ Map -> Maybe Text
backgroundColor :: Maybe Text
, Map -> Maybe Int
compressionLevel :: Maybe Int
, Map -> Int
height :: Int
, Map -> Maybe Int
hexSideLength :: Maybe Int
, Map -> Maybe Bool
infinite :: Maybe Bool
, Map -> Vector Layer
layers :: Vector Layer
, Map -> Int
nextLayerId :: Int
, Map -> Int
nextObjectId :: Int
, Map -> Text
orientation :: Text
, Map -> Maybe Double
parallaxOriginX :: Maybe Double
, Map -> Maybe Double
parallaxOriginY :: Maybe Double
, Map -> Maybe (Vector Property)
properties :: Maybe (Vector Property)
, Map -> Maybe Text
renderOrder :: Maybe Text
, Map -> Maybe Text
staggerAxis :: Maybe Text
, Map -> Maybe Text
staggerIndex :: Maybe Text
, Map -> Text
tiledVersion :: Text
, Map -> Int
tileHeight :: Int
, Map -> Vector TilesetRef
tilesets :: Vector TilesetRef
, Map -> Int
tileWidth :: Int
, Map -> Text
type_ :: Text
, Map -> Text
version :: Text
, Map -> Int
width :: Int
}
deriving (Map -> Map -> Bool
(Map -> Map -> Bool) -> (Map -> Map -> Bool) -> Eq Map
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 -> String
(Int -> Map -> ShowS)
-> (Map -> String) -> ([Map] -> ShowS) -> Show Map
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Map] -> ShowS
$cshowList :: [Map] -> ShowS
show :: Map -> String
$cshow :: Map -> String
showsPrec :: Int -> Map -> ShowS
$cshowsPrec :: Int -> Map -> ShowS
Show, (forall x. Map -> Rep Map x)
-> (forall x. Rep Map x -> Map) -> Generic Map
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)
instance FromJSON Map where
parseJSON :: Value -> Parser Map
parseJSON = Value -> Parser Map
forall a. (Generic a, GFromJSON Zero (Rep a)) => Value -> Parser a
genericParseJSON
instance ToJSON Map where
toJSON :: Map -> Value
toJSON = Map -> Value
forall a. (Generic a, GToJSON' Value Zero (Rep a)) => a -> Value
genericToJSON