Safe Haskell | None |
---|---|
Language | Haskell2010 |
The type of game rule sets and assorted game data.
- data RuleKind = RuleKind {
- rsymbol :: !Char
- rname :: !Text
- rfreq :: !(Freqs RuleKind)
- raccessible :: !(Maybe (Point -> Point -> Bool))
- raccessibleDoor :: !(Maybe (Point -> Point -> Bool))
- rtitle :: !Text
- rpathsDataFile :: FilePath -> IO FilePath
- rpathsVersion :: !Version
- rcfgUIName :: !FilePath
- rcfgUIDefault :: !String
- rmainMenuArt :: !Text
- rfirstDeathEnds :: !Bool
- rfovMode :: !FovMode
- rwriteSaveClips :: !Int
- rleadLevelClips :: !Int
- rscoresFile :: !FilePath
- rsavePrefix :: !String
- rnearby :: !Int
- data FovMode
- = Shadow
- | Permissive
- | Digital
- validateSingleRuleKind :: RuleKind -> [Text]
- validateAllRuleKind :: [RuleKind] -> [Text]
Documentation
The type of game rule sets and assorted game data.
For now the rules are immutable througout the game, so there is
no type Rule
to hold any changing parameters, just RuleKind
for the fixed set.
However, in the future, if the rules can get changed during gameplay
based on data mining of player behaviour, we may add such a type
and then RuleKind
will become just a starting template, analogously
as for the other content.
The raccessible
field holds extra conditions that have to be met
for a tile to be accessible, on top of being an open tile
(or openable, in some contexts). The raccessibleDoor
field
contains yet additional conditions concerning tiles that are doors,
whether open or closed.
Precondition: the two positions are next to each other.
We assume the predicate is symmetric.
RuleKind | |
|
Field Of View scanning mode.
Shadow | restrictive shadow casting (not symmetric!) |
Permissive | permissive FOV |
Digital | digital FOV |
validateSingleRuleKind :: RuleKind -> [Text] Source
Catch invalid rule kind definitions. In particular, this validates the ASCII art format (TODO).
validateAllRuleKind :: [RuleKind] -> [Text] Source
Since we have only one rule kind, the set of rule kinds is always valid.