Safe Haskell | None |
---|---|
Language | Haskell2010 |
Semantics of responses that are sent from server to clients, in terms of client state transformations, and semantics of human commands and AI moves, in terms of requests to be sent from the client to the server.
See https://github.com/LambdaHack/LambdaHack/wiki/Client-server-architecture.
Synopsis
- loopCli :: (MonadClientSetup m, MonadClientUI m, MonadClientAtomic m, MonadClientReadResponse m, MonadClientWriteRequest m) => CCUI -> UIOptions -> ClientOptions -> m ()
- type RequestAI = (ReqAI, Maybe ActorId)
- data ReqAI
- type RequestUI = (ReqUI, Maybe ActorId)
- data ReqUI
- data RequestTimed
- data Response
- data ClientOptions = ClientOptions {
- sgtkFontFamily :: Maybe Text
- sdlFontFile :: Maybe Text
- sdlScalableSizeAdd :: Maybe Int
- sdlBitmapSizeAdd :: Maybe Int
- sscalableFontSize :: Maybe Int
- slogPriority :: Maybe Int
- smaxFps :: Maybe Int
- sdisableAutoYes :: Bool
- snoAnim :: Maybe Bool
- snewGameCli :: Bool
- sbenchmark :: Bool
- stitle :: Maybe Text
- sfontDir :: Maybe FilePath
- ssavePrefixCli :: String
- sfrontendTeletype :: Bool
- sfrontendNull :: Bool
- sfrontendLazy :: Bool
- sdbgMsgCli :: Bool
- sstopAfterSeconds :: Maybe Int
- sstopAfterFrames :: Maybe Int
- sprintEachScreen :: Bool
- sexposePlaces :: Bool
- sexposeItems :: Bool
- sexposeActors :: Bool
- defClientOptions :: ClientOptions
- data CCUI
- data UIOptions
- applyUIOptions :: COps -> UIOptions -> ClientOptions -> ClientOptions
- uCmdline :: UIOptions -> [String]
- mkUIOptions :: COps -> Bool -> IO UIOptions
Re-exported from Game.LambdaHack.Client.LoopM
loopCli :: (MonadClientSetup m, MonadClientUI m, MonadClientAtomic m, MonadClientReadResponse m, MonadClientWriteRequest m) => CCUI -> UIOptions -> ClientOptions -> m () Source #
The main game loop for an AI or UI client. It receives responses from the server, changes internal client state accordingly, analyzes ensuing human or AI commands and sends resulting requests to the server. Depending on whether it's an AI or UI client, it sends AI or human player requests.
The loop is started in client state that is empty except for
the sside
and seps
fields, see emptyStateClient
.
Re-exported from Game.LambdaHack.Client.Request
type RequestAI = (ReqAI, Maybe ActorId) Source #
Requests sent by AI clients to the server. If faction leader is to be changed, it's included as the second component.
Possible forms of requests sent by AI clients.
type RequestUI = (ReqUI, Maybe ActorId) Source #
Requests sent by UI clients to the server. If faction leader is to be changed, it's included as the second component.
Possible forms of requests sent by UI clients.
data RequestTimed Source #
Requests that take game time.
Instances
Show RequestTimed Source # | |
Defined in Game.LambdaHack.Client.Request showsPrec :: Int -> RequestTimed -> ShowS # show :: RequestTimed -> String # showList :: [RequestTimed] -> ShowS # |
Re-exported from Game.LambdaHack.Client.Response
Abstract syntax of responses sent by server to an AI or UI client (or a universal client that can handle both roles, which is why this type is not separated into distinct AI and UI types). A response tells a client how to update game state or what information to send to the server.
RespUpdAtomicNoState UpdAtomic | change |
RespUpdAtomic State UpdAtomic | put the given |
RespQueryAI ActorId | compute an AI move for the actor and send (the semantics of) it |
RespSfxAtomic SfxAtomic | perform special effects (animations, messages, etc.) |
RespQueryUI | prompt the human player for a command and send (the semantics of) it |
Re-exported from Game.LambdaHack.Client.ClientOptions
data ClientOptions Source #
Options that affect the behaviour of the client (but not game rules).
ClientOptions | |
|
Instances
defClientOptions :: ClientOptions Source #
Default value of client options.
Re-exported from Game.LambdaHack.Client.UI
Options that affect the UI of the client.
Instances
applyUIOptions :: COps -> UIOptions -> ClientOptions -> ClientOptions Source #
Modify client options with UI options.