Safe Haskell | Safe-Infered |
---|
Game state and persistent player diary types and operations.
- data State = State {}
- data TgtMode
- = TgtOff
- | TgtExplicit
- | TgtAuto
- data Cursor = Cursor {}
- slevel :: State -> Level
- stime :: State -> Time
- defaultState :: CP -> 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 save and restored. In practice, we maintain some extra state, but it's temporary for a single turn or relevant only to the current session.
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.
Accessor
Constructor
defaultState :: CP -> 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. That includes the last message, previous messages and otherwise recorded history of past games. This can be used for calculating player achievements, unlocking advanced game features and general data mining.
defaultDiary :: IO DiarySource
Initial player diary.
Debug flags
cycleMarkVision :: State -> StateSource
toggleOmniscient :: State -> StateSource