Safe Haskell | None |
---|
Game state and persistent player diary types and operations.
- data State = State {}
- data TgtMode
- = TgtOff
- | TgtExplicit
- | TgtAuto
- data Cursor = Cursor {}
- data Status
- slevel :: State -> Level
- stime :: State -> Time
- defaultState :: CP -> Id FactionKind -> FlavourMap -> Dungeon -> LevelId -> Point -> StdGen -> State
- updateCursor :: (Cursor -> Cursor) -> State -> State
- updateTime :: (Time -> Time) -> State -> State
- updateDiscoveries :: (Discoveries -> Discoveries) -> State -> State
- updateLevel :: (Level -> Level) -> State -> State
- updateDungeon :: (Dungeon -> Dungeon) -> State -> State
- data Diary = Diary {}
- defaultDiary :: IO Diary
- data DebugMode = DebugMode {}
- cycleMarkVision :: State -> State
- toggleOmniscient :: State -> State
Game state
The state of a single game that can be saved and restored. It's completely disregarded and reset when a new game is started. In practice, we maintain some extra state (DungeonPerception), but it's only temporary, existing for a single turn and then invalidated.
State | |
|
Current targeting mode of the player.
TgtOff | not in targeting mode |
TgtExplicit | the player requested targeting mode explicitly |
TgtAuto | the mode was entered (and will be exited) automatically |
Current targeting cursor parameters.
Current result of the game.
Accessor
Constructor
defaultState :: CP -> Id FactionKind -> FlavourMap -> Dungeon -> LevelId -> Point -> StdGen -> StateSource
Initial game state.
State update
updateDiscoveries :: (Discoveries -> Discoveries) -> State -> StateSource
Update item discoveries within state.
Player diary
The diary contains all the player data that carries over from game to game, even across playing sessions. That includes the last message, previous messages and otherwise recorded history of past games. This can be extended with other data and used for calculating player achievements, unlocking advanced game features and for general data mining, e.g., augmenting AI or procedural content generation.
defaultDiary :: IO DiarySource
Initial player diary.
Debug flags
cycleMarkVision :: State -> StateSource
toggleOmniscient :: State -> StateSource