{-# LANGUAGE DeriveGeneric #-}

module Battlesnake.Core.Game where

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

{-|
  Information about the current game configuration.
  See: https://docs.battlesnake.com/api/objects/game
-}
data Game = Game
  { Game -> Text
id :: Text
  -- ^ The ID of the game.
  , Game -> Ruleset
ruleset :: Ruleset
  -- ^ The ruleset used in the game.
  , Game -> Text
map :: Text
  -- ^ The name of the map used to create the game. (See
  -- https://docs.battlesnake.com/api/objects/game-maps for possible values.)
  , Game -> Integer
timeout :: Integer
  -- ^ The maximum time in milliseconds the server will wait for a response from
  -- your server.
  , Game -> Text
source :: Text
  -- ^ The source of the game.
  }
  deriving (Int -> Game -> ShowS
[Game] -> ShowS
Game -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Game] -> ShowS
$cshowList :: [Game] -> ShowS
show :: Game -> String
$cshow :: Game -> String
showsPrec :: Int -> Game -> ShowS
$cshowsPrec :: Int -> Game -> ShowS
Show, Game -> Game -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Game -> Game -> Bool
$c/= :: Game -> Game -> Bool
== :: Game -> Game -> Bool
$c== :: Game -> Game -> Bool
Eq, forall x. Rep Game x -> Game
forall x. Game -> Rep Game x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Game x -> Game
$cfrom :: forall x. Game -> Rep Game x
Generic)

instance FromJSON Game