LambdaHack-0.8.1.2: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Server.MonadServer

Contents

Description

Basic server monads and related operations.

Synopsis

The server monad

class MonadServer m => MonadServerAtomic m where Source #

The monad for executing atomic game state transformations.

Methods

execUpdAtomic :: UpdAtomic -> m () Source #

Execute an atomic command that changes the state on the server and on all clients that can notice it.

execUpdAtomicSer :: UpdAtomic -> m Bool Source #

Execute an atomic command that changes the state on the server only.

execUpdAtomicFid :: FactionId -> UpdAtomic -> m () Source #

Execute an atomic command that changes the state on the given single client only.

execUpdAtomicFidCatch :: FactionId -> UpdAtomic -> m Bool Source #

Execute an atomic command that changes the state on the given single client only. Catch AtomicFail and indicate if it was in fact raised.

execSfxAtomic :: SfxAtomic -> m () Source #

Execute an atomic command that only displays special effects.

execSendPer :: FactionId -> LevelId -> Perception -> Perception -> Perception -> m () Source #

Assorted primitives

dumpRngs :: MonadServer m => RNGs -> m () Source #

Dumps to stdout the RNG states from the start of the game.

restoreScore :: forall m. MonadServer m => COps -> m ScoreDict Source #

Read the high scores dictionary. Return the empty table if no file.

registerScore :: MonadServer m => Status -> FactionId -> m () Source #

Generate a new score, register it and save.

rndToAction :: MonadServer m => Rnd a -> m a Source #

Invoke pseudo-random computation with the generator kept in the state.

getSetGen :: MonadServer m => Maybe StdGen -> m StdGen Source #

Gets a random generator from the user-submitted options or, if not present, generates one.