| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Game.LambdaHack.Common.State
Description
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 -> ScoreDict
- sgameModeId :: State -> Id ModeKind
- defStateGlobal :: Dungeon -> AbsDepth -> FactionDict -> COps -> ScoreDict -> Id ModeKind -> State
- emptyState :: COps -> 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 #
State operations
defStateGlobal :: Dungeon -> AbsDepth -> FactionDict -> COps -> ScoreDict -> Id ModeKind -> State Source #
Initial complete global game state.
emptyState :: COps -> State Source #
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.