{-# LANGUAGE DeriveGeneric #-}

module Battlesnake.API.GameRequest where

import Battlesnake.Core.Battlesnake (Battlesnake)
import Battlesnake.Core.Board (Board)
import Battlesnake.Core.Game (Game)
import Data.Aeson (FromJSON)
import GHC.Generics

{-|
  The request sent to your battlesnake server on each turn.
  This contains all the information you need to determine your snakes next move.}
-}
data GameRequest = GameRequest
  { GameRequest -> Game
game :: Game, -- ^ Information about the current game. (See "Battlesnake.Core.Game")
    GameRequest -> Integer
turn :: Integer, -- ^ The turn beeing played.
    GameRequest -> Board
board :: Board, -- ^ The game board. (See "Battlesnake.Core.Board")
    GameRequest -> Battlesnake
you :: Battlesnake -- ^ Your snake. (See "Battlesnake.Core.Battlesnake"")
  }
  deriving (Int -> GameRequest -> ShowS
[GameRequest] -> ShowS
GameRequest -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GameRequest] -> ShowS
$cshowList :: [GameRequest] -> ShowS
show :: GameRequest -> String
$cshow :: GameRequest -> String
showsPrec :: Int -> GameRequest -> ShowS
$cshowsPrec :: Int -> GameRequest -> ShowS
Show, forall x. Rep GameRequest x -> GameRequest
forall x. GameRequest -> Rep GameRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GameRequest x -> GameRequest
$cfrom :: forall x. GameRequest -> Rep GameRequest x
Generic)

instance FromJSON GameRequest