module Game.LambdaHack.Content.RuleKind
( RuleContent(..), emptyRuleContent, makeData
#ifdef EXPOSE_INTERNAL
, validateSingle
#endif
) where
import Prelude ()
import Game.LambdaHack.Core.Prelude
import qualified Data.Ini as Ini
import qualified Data.Ini.Types as Ini
import Data.Version
import Game.LambdaHack.Content.ItemKind
(ItemSymbolsUsedInEngine, emptyItemSymbolsUsedInEngine)
import Game.LambdaHack.Definition.Defs
data RuleContent = RuleContent
{ RuleContent -> String
rtitle :: String
, RuleContent -> X
rWidthMax :: X
, RuleContent -> X
rHeightMax :: Y
, RuleContent -> Version
rexeVersion :: Version
, RuleContent -> String
rcfgUIName :: FilePath
, RuleContent -> (String, Config)
rcfgUIDefault :: (String, Ini.Config)
, RuleContent -> X
rwriteSaveClips :: Int
, RuleContent -> X
rleadLevelClips :: Int
, RuleContent -> String
rscoresFile :: FilePath
, RuleContent -> X
rnearby :: Int
, RuleContent -> [Text]
rstairWordCarried :: [Text]
, RuleContent -> ItemSymbolsUsedInEngine
ritemSymbols :: ItemSymbolsUsedInEngine
}
emptyRuleContent :: RuleContent
emptyRuleContent :: RuleContent
emptyRuleContent = RuleContent :: String
-> X
-> X
-> Version
-> String
-> (String, Config)
-> X
-> X
-> String
-> X
-> [Text]
-> ItemSymbolsUsedInEngine
-> RuleContent
RuleContent
{ rtitle :: String
rtitle = String
""
, rWidthMax :: X
rWidthMax = X
0
, rHeightMax :: X
rHeightMax = X
0
, rexeVersion :: Version
rexeVersion = [X] -> Version
makeVersion []
, rcfgUIName :: String
rcfgUIName = String
""
, rcfgUIDefault :: (String, Config)
rcfgUIDefault = (String
"", Config
Ini.emptyConfig)
, rwriteSaveClips :: X
rwriteSaveClips = X
0
, rleadLevelClips :: X
rleadLevelClips = X
0
, rscoresFile :: String
rscoresFile = String
""
, rnearby :: X
rnearby = X
0
, rstairWordCarried :: [Text]
rstairWordCarried = []
, ritemSymbols :: ItemSymbolsUsedInEngine
ritemSymbols = ItemSymbolsUsedInEngine
emptyItemSymbolsUsedInEngine
}
validateSingle :: RuleContent -> [Text]
validateSingle :: RuleContent -> [Text]
validateSingle RuleContent
_ = []
makeData :: RuleContent -> RuleContent
makeData :: RuleContent -> RuleContent
makeData RuleContent
rc =
let singleOffenders :: [Text]
singleOffenders = RuleContent -> [Text]
validateSingle RuleContent
rc
in Bool -> RuleContent -> RuleContent
forall a. (?callStack::CallStack) => Bool -> a -> a
assert ([Text] -> Bool
forall a. [a] -> Bool
null [Text]
singleOffenders
Bool -> (String, [Text]) -> Bool
forall a. Show a => Bool -> a -> Bool
`blame` String
"Rule Content not valid"
String -> [Text] -> (String, [Text])
forall v. String -> v -> (String, v)
`swith` [Text]
singleOffenders)
RuleContent
rc