module Codec.Tiled.Tileset where
import Data.Text (Text)
import Data.Vector (Vector)
import GHC.Generics (Generic)
import Codec.Tiled.Aeson (FromJSON(..), ToJSON(..), genericParseJSON, genericToJSON)
import Codec.Tiled.Property (Property)
import Codec.Tiled.Tileset.Grid (Grid)
import Codec.Tiled.Tileset.Terrain (Terrain)
import Codec.Tiled.Tileset.Tile (Tile)
import Codec.Tiled.Tileset.TileOffset (TileOffset)
import Codec.Tiled.Tileset.Transformations (Transformations)
import Codec.Tiled.Tileset.WangSet (WangSet)
import Data.Tiled.GID (GID)
data Tileset = Tileset
{ Tileset -> Maybe Text
backgroundColor :: Maybe Text
, Tileset -> Int
columns :: Int
, Tileset -> Maybe GID
firstGid :: Maybe GID
, Tileset -> Maybe Grid
grid :: Maybe Grid
, Tileset -> FilePath
image :: FilePath
, Tileset -> Int
imageHeight :: Int
, Tileset -> Int
imageWidth :: Int
, Tileset -> Int
margin :: Int
, Tileset -> Text
name :: Text
, Tileset -> Maybe Text
objectAlignment :: Maybe Text
, Tileset -> Maybe (Vector Property)
properties :: Maybe (Vector Property)
, Tileset -> Maybe FilePath
source :: Maybe FilePath
, Tileset -> Int
spacing :: Int
, Tileset -> Maybe (Vector Terrain)
terrains :: Maybe (Vector Terrain)
, Tileset -> Int
tileCount :: Int
, Tileset -> Maybe Text
tiledVersion :: Maybe Text
, Tileset -> Int
tileHeight :: Int
, Tileset -> Maybe TileOffset
tileOffset :: Maybe TileOffset
, Tileset -> Maybe (Vector Tile)
tiles :: Maybe (Vector Tile)
, Tileset -> Int
tileWidth :: Int
, Tileset -> Maybe Transformations
transformations :: Maybe Transformations
, Tileset -> Maybe Text
transparentColor :: Maybe Text
, Tileset -> Maybe Text
type_ :: Maybe Text
, Tileset -> Maybe Text
version :: Maybe Text
, Tileset -> Maybe (Vector WangSet)
wangSets :: Maybe (Vector WangSet)
}
deriving (Tileset -> Tileset -> Bool
(Tileset -> Tileset -> Bool)
-> (Tileset -> Tileset -> Bool) -> Eq Tileset
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Tileset -> Tileset -> Bool
$c/= :: Tileset -> Tileset -> Bool
== :: Tileset -> Tileset -> Bool
$c== :: Tileset -> Tileset -> Bool
Eq, Int -> Tileset -> ShowS
[Tileset] -> ShowS
Tileset -> FilePath
(Int -> Tileset -> ShowS)
-> (Tileset -> FilePath) -> ([Tileset] -> ShowS) -> Show Tileset
forall a.
(Int -> a -> ShowS) -> (a -> FilePath) -> ([a] -> ShowS) -> Show a
showList :: [Tileset] -> ShowS
$cshowList :: [Tileset] -> ShowS
show :: Tileset -> FilePath
$cshow :: Tileset -> FilePath
showsPrec :: Int -> Tileset -> ShowS
$cshowsPrec :: Int -> Tileset -> ShowS
Show, (forall x. Tileset -> Rep Tileset x)
-> (forall x. Rep Tileset x -> Tileset) -> Generic Tileset
forall x. Rep Tileset x -> Tileset
forall x. Tileset -> Rep Tileset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Tileset x -> Tileset
$cfrom :: forall x. Tileset -> Rep Tileset x
Generic)
instance FromJSON Tileset where
parseJSON :: Value -> Parser Tileset
parseJSON = Value -> Parser Tileset
forall a. (Generic a, GFromJSON Zero (Rep a)) => Value -> Parser a
genericParseJSON
instance ToJSON Tileset where
toJSON :: Tileset -> Value
toJSON = Tileset -> Value
forall a. (Generic a, GToJSON' Value Zero (Rep a)) => a -> Value
genericToJSON