Safe Haskell | None |
---|---|
Language | Haskell2010 |
Server and client game state types and operations.
- data State
- sdungeon :: State -> Dungeon
- stotalDepth :: State -> AbsDepth
- sactorD :: State -> ActorDict
- sitemD :: State -> ItemDict
- sfactionD :: State -> FactionDict
- stime :: State -> Time
- scops :: State -> COps
- shigh :: State -> ScoreTable
- defStateGlobal :: Dungeon -> AbsDepth -> FactionDict -> COps -> ScoreTable -> State
- emptyState :: State
- localFromGlobal :: State -> State
- updateDungeon :: (Dungeon -> Dungeon) -> State -> State
- updateDepth :: (AbsDepth -> AbsDepth) -> State -> State
- updateActorD :: (ActorDict -> ActorDict) -> State -> State
- updateItemD :: (ItemDict -> ItemDict) -> State -> State
- updateFactionD :: (FactionDict -> FactionDict) -> State -> State
- updateTime :: (Time -> Time) -> State -> State
- updateCOps :: (COps -> COps) -> State -> State
Basic game state, local or global
View on game state. Remembered fields carry a subset of the info
in the client copies of the state. Clients never directly change
their State
, but apply atomic actions sent by the server to do so.
State components
stotalDepth :: State -> AbsDepth Source
sfactionD :: State -> FactionDict Source
shigh :: State -> ScoreTable Source
State operations
defStateGlobal :: Dungeon -> AbsDepth -> FactionDict -> COps -> ScoreTable -> State Source
Initial complete global game state.
Initial empty state.
localFromGlobal :: State -> State Source
Local state created by removing secret information from global state components.
updateFactionD :: (FactionDict -> FactionDict) -> State -> State Source
Update faction data within state.