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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Client.HandleResponseM

Description

Semantics of responses sent by the server to clients.

Synopsis

Documentation

class MonadClient m => MonadClientWriteRequest m where Source #

Client monad in which one can send requests to the client.

Minimal complete definition

sendRequestAI, sendRequestUI, clientHasUI

class MonadClient m => MonadClientAtomic m where Source #

Monad for executing atomic game state transformations on a client.

Minimal complete definition

execUpdAtomic, execPutState

Methods

execUpdAtomic :: UpdAtomic -> m () Source #

Execute an atomic update that changes the client's State.

execPutState :: State -> m () Source #

Put state that is intended to be the result of performing an atomic update by the server on its copy of the client's State.

handleResponse :: (MonadClientSetup m, MonadClientUI m, MonadClientAtomic m, MonadClientWriteRequest m) => Response -> m () Source #

Handle server responses.

Note that for clients communicating with the server over the net, RespUpdAtomicNoState should be used, because executing a single command is cheaper than sending the whole state over the net. However, for the standalone exe mode, with clients in the same process as the server, a pointer to the state set with execPutState is cheaper.