module Codec.Tiled.World.Pattern where

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

data Pattern = Pattern
  { Pattern -> Text
regexp      :: Text
  , Pattern -> Maybe Int
mapHeight   :: Maybe Int
  , Pattern -> Maybe Int
mapWidth    :: Maybe Int
  , Pattern -> Int
multiplierX :: Int
  , Pattern -> Int
multiplierY :: Int
  , Pattern -> Int
offsetX     :: Int
  , Pattern -> Int
offsetY     :: Int
  }
  deriving (Pattern -> Pattern -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Pattern -> Pattern -> Bool
$c/= :: Pattern -> Pattern -> Bool
== :: Pattern -> Pattern -> Bool
$c== :: Pattern -> Pattern -> Bool
Eq, Int -> Pattern -> ShowS
[Pattern] -> ShowS
Pattern -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Pattern] -> ShowS
$cshowList :: [Pattern] -> ShowS
show :: Pattern -> String
$cshow :: Pattern -> String
showsPrec :: Int -> Pattern -> ShowS
$cshowsPrec :: Int -> Pattern -> ShowS
Show, forall x. Rep Pattern x -> Pattern
forall x. Pattern -> Rep Pattern x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Pattern x -> Pattern
$cfrom :: forall x. Pattern -> Rep Pattern x
Generic)

instance FromJSON Pattern
instance ToJSON Pattern