{-# LANGUAGE TemplateHaskell #-}
-- | Game rules and assorted game setup data.
module Content.RuleKind
  ( standardRules
  ) where

import Prelude ()

import Language.Haskell.TH.Syntax
import System.FilePath
import System.IO (readFile)

-- Cabal
import qualified Paths_LambdaHack as Self (getDataFileName, version)

import Game.LambdaHack.Content.RuleKind

standardRules :: RuleContent
standardRules :: RuleContent
standardRules = $WRuleContent :: Text
-> X
-> X
-> FilePath
-> Version
-> FilePath
-> FilePath
-> X
-> X
-> FilePath
-> X
-> [Text]
-> Char
-> RuleContent
RuleContent
  { rtitle :: Text
rtitle = "LambdaHack"
  , rXmax :: X
rXmax = 80
  , rYmax :: X
rYmax = 21
  , rfontDir :: FilePath
rfontDir = $(do
      x <- qRunIO (Self.getDataFileName "GameDefinition/fonts")
      lift x)
  , rexeVersion :: Version
rexeVersion = Version
Self.version
  -- The strings containing the default configuration file
  -- included from config.ui.default.
  , rcfgUIName :: FilePath
rcfgUIName = "config.ui" FilePath -> FilePath -> FilePath
<.> "ini"
  , rcfgUIDefault :: FilePath
rcfgUIDefault = $(do
      let path = "GameDefinition" </> "config.ui" <.> "default"
      qAddDependentFile path
      x <- qRunIO (readFile path)
      lift x)
  , rwriteSaveClips :: X
rwriteSaveClips = 1000
  , rleadLevelClips :: X
rleadLevelClips = 50
  , rscoresFile :: FilePath
rscoresFile = "LambdaHack.scores"
  , rnearby :: X
rnearby = 20
  , rstairWordCarried :: [Text]
rstairWordCarried = ["staircase"]  -- only one, so inert
  , rsymbolProjectile :: Char
rsymbolProjectile = '|'
  }