module Codec.Tiled.Tileset
( Tileset(..)
, empty
) 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
empty :: Tileset
empty :: Tileset
empty = Tileset :: Maybe Text
-> Int
-> Maybe GID
-> Maybe Grid
-> FilePath
-> Int
-> Int
-> Int
-> Text
-> Maybe Text
-> Maybe (Vector Property)
-> Maybe FilePath
-> Int
-> Maybe (Vector Terrain)
-> Int
-> Maybe Text
-> Int
-> Maybe TileOffset
-> Maybe (Vector Tile)
-> Int
-> Maybe Transformations
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Vector WangSet)
-> Tileset
Tileset
{ backgroundColor :: Maybe Text
backgroundColor = Maybe Text
forall a. Maybe a
Nothing
, columns :: Int
columns = Int
0
, firstGid :: Maybe GID
firstGid = Maybe GID
forall a. Maybe a
Nothing
, grid :: Maybe Grid
grid = Maybe Grid
forall a. Maybe a
Nothing
, image :: FilePath
image = FilePath
""
, imageHeight :: Int
imageHeight = Int
0
, imageWidth :: Int
imageWidth = Int
0
, margin :: Int
margin = Int
0
, name :: Text
name = Text
""
, objectAlignment :: Maybe Text
objectAlignment = Maybe Text
forall a. Maybe a
Nothing
, properties :: Maybe (Vector Property)
properties = Maybe (Vector Property)
forall a. Maybe a
Nothing
, source :: Maybe FilePath
source = Maybe FilePath
forall a. Maybe a
Nothing
, spacing :: Int
spacing = Int
0
, terrains :: Maybe (Vector Terrain)
terrains = Maybe (Vector Terrain)
forall a. Maybe a
Nothing
, tileCount :: Int
tileCount = Int
0
, tiledVersion :: Maybe Text
tiledVersion = Maybe Text
forall a. Maybe a
Nothing
, tileHeight :: Int
tileHeight = Int
0
, tileOffset :: Maybe TileOffset
tileOffset = Maybe TileOffset
forall a. Maybe a
Nothing
, tiles :: Maybe (Vector Tile)
tiles = Maybe (Vector Tile)
forall a. Maybe a
Nothing
, tileWidth :: Int
tileWidth = Int
0
, transformations :: Maybe Transformations
transformations = Maybe Transformations
forall a. Maybe a
Nothing
, transparentColor :: Maybe Text
transparentColor = Maybe Text
forall a. Maybe a
Nothing
, type_ :: Maybe Text
type_ = Maybe Text
forall a. Maybe a
Nothing
, version :: Maybe Text
version = Maybe Text
forall a. Maybe a
Nothing
, wangSets :: Maybe (Vector WangSet)
wangSets = Maybe (Vector WangSet)
forall a. Maybe a
Nothing
}