LambdaHack-0.2.12: A roguelike game engine in early and active development

Safe HaskellNone

Game.LambdaHack.Server.Action

Contents

Description

Game action monads and basic building blocks for human and computer player actions. Has no access to the the main action type. Does not export the liftIO operation nor a few other implementation details.

Synopsis

Action monads

updateConn :: (MonadAtomic m, MonadConnServer m) => (FactionId -> ChanFrontend -> ChanServer CmdClientUI CmdSer -> IO ()) -> (FactionId -> ChanServer CmdClientAI CmdTakeTimeSer -> IO ()) -> m ()Source

Update connections to the new definition of factions. Connect to clients in old or newly spawned threads that read and write directly to the channels.

speedupCOps :: Bool -> COps -> COpsSource

Compute and insert auxiliary optimized components into game content, to be used in time-critical sections of the code.

Communication

Assorted primitives

dumpRngs :: MonadServer m => m ()Source

Dumps RNG states from the start of the game to a file.

getSetGen :: MonadServer m => Maybe StdGen -> m StdGenSource

Gets a random generator from the arguments or, if not present, generates one.

restoreScore :: MonadServer m => COps -> m ScoreTableSource

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

rndToAction :: MonadServer m => Rnd a -> m aSource

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

resetFidPerception :: MonadServer m => FactionId -> LevelId -> m ()Source

Update the cached perception for the selected level, for a faction. The assumption is the level, and only the level, has changed since the previous perception calculation.