LambdaHack- A game engine library for roguelike dungeon crawlers

Safe HaskellNone




Server and client game state types and operations.


Basic game state, local or global

data State Source

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

State operations

defStateGlobal :: Dungeon -> AbsDepth -> FactionDict -> COps -> ScoreDict -> Id ModeKind -> State Source

Initial complete global game state.

emptyState :: State Source

Initial empty state.

localFromGlobal :: State -> State Source

Local state created by removing secret information from global state components.

updateDungeon :: (Dungeon -> Dungeon) -> State -> State Source

Update dungeon data within state.

updateDepth :: (AbsDepth -> AbsDepth) -> State -> State Source

Update dungeon depth.

updateActorD :: (ActorDict -> ActorDict) -> State -> State Source

Update the actor dictionary.

updateItemD :: (ItemDict -> ItemDict) -> State -> State Source

Update the item dictionary.

updateFactionD :: (FactionDict -> FactionDict) -> State -> State Source

Update faction data within state.

updateTime :: (Time -> Time) -> State -> State Source

Update global time within state.

updateCOps :: (COps -> COps) -> State -> State Source

Update content data within state.