{-# LANGUAGE DeriveGeneric #-}

module Battlesnake.Core.Ruleset where

import Battlesnake.Core.RulesetSettings (RulesetSettings)
import Data.Aeson (FromJSON)
import Data.Text
import GHC.Generics

{-|
  Information about the ruleset used in the game.
  See: https://docs.battlesnake.com/api/objects/ruleset
-}
data Ruleset = Ruleset
  { Ruleset -> Text
name :: Text
  -- ^ The name of the ruleset.
  , Ruleset -> Text
version :: Text
  -- ^ The version of the ruleset.
  , Ruleset -> RulesetSettings
settings :: RulesetSettings
  }
  deriving (Int -> Ruleset -> ShowS
[Ruleset] -> ShowS
Ruleset -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Ruleset] -> ShowS
$cshowList :: [Ruleset] -> ShowS
show :: Ruleset -> String
$cshow :: Ruleset -> String
showsPrec :: Int -> Ruleset -> ShowS
$cshowsPrec :: Int -> Ruleset -> ShowS
Show, Ruleset -> Ruleset -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Ruleset -> Ruleset -> Bool
$c/= :: Ruleset -> Ruleset -> Bool
== :: Ruleset -> Ruleset -> Bool
$c== :: Ruleset -> Ruleset -> Bool
Eq, forall x. Rep Ruleset x -> Ruleset
forall x. Ruleset -> Rep Ruleset x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Ruleset x -> Ruleset
$cfrom :: forall x. Ruleset -> Rep Ruleset x
Generic)

instance FromJSON Ruleset