module Codec.Tiled.Tileset.Transformations
( Transformations(..)
, empty
) where
import GHC.Generics (Generic)
import Codec.Tiled.Aeson (FromJSON(..), ToJSON(..), genericParseJSON, genericToJSON)
data Transformations = Transformations
{ Transformations -> Maybe Bool
hFlip :: Maybe Bool
, Transformations -> Maybe Bool
vFlip :: Maybe Bool
, Transformations -> Maybe Bool
rotate :: Maybe Bool
, Transformations -> Maybe Bool
preferUntransformed :: Maybe Bool
}
deriving (Transformations -> Transformations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Transformations -> Transformations -> Bool
$c/= :: Transformations -> Transformations -> Bool
== :: Transformations -> Transformations -> Bool
$c== :: Transformations -> Transformations -> Bool
Eq, Int -> Transformations -> ShowS
[Transformations] -> ShowS
Transformations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Transformations] -> ShowS
$cshowList :: [Transformations] -> ShowS
show :: Transformations -> String
$cshow :: Transformations -> String
showsPrec :: Int -> Transformations -> ShowS
$cshowsPrec :: Int -> Transformations -> ShowS
Show, forall x. Rep Transformations x -> Transformations
forall x. Transformations -> Rep Transformations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Transformations x -> Transformations
$cfrom :: forall x. Transformations -> Rep Transformations x
Generic)
instance FromJSON Transformations where
parseJSON :: Value -> Parser Transformations
parseJSON = forall a. (Generic a, GFromJSON Zero (Rep a)) => Value -> Parser a
genericParseJSON
instance ToJSON Transformations where
toJSON :: Transformations -> Value
toJSON = forall a. (Generic a, GToJSON' Value Zero (Rep a)) => a -> Value
genericToJSON
empty :: Transformations
empty :: Transformations
empty = Transformations
{ hFlip :: Maybe Bool
hFlip = forall a. Maybe a
Nothing
, vFlip :: Maybe Bool
vFlip = forall a. Maybe a
Nothing
, rotate :: Maybe Bool
rotate = forall a. Maybe a
Nothing
, preferUntransformed :: Maybe Bool
preferUntransformed = forall a. Maybe a
Nothing
}