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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Client

Contents

Description

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

Re-exported from Game.LambdaHack.Client.LoopM

loopCli :: (MonadClientSetup m, MonadClientUI m, MonadClientAtomic m, MonadClientReadResponse m, MonadClientWriteRequest m) => KeyKind -> UIOptions -> ClientOptions -> m () #

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) #

Requests sent by AI clients to the server. If faction leader is to be changed, it's included as the second component.

data ReqAI #

Possible forms of requests sent by AI clients.

Instances
Show ReqAI # 
Instance details

Defined in Game.LambdaHack.Client.Request

Methods

showsPrec :: Int -> ReqAI -> ShowS #

show :: ReqAI -> String #

showList :: [ReqAI] -> ShowS #

type RequestUI = (ReqUI, Maybe ActorId) #

Requests sent by UI clients to the server. If faction leader is to be changed, it's included as the second component.

data RequestTimed #

Requests that take game time, indexed by actor ability that is needed for performing the corresponding actions.

Re-exported from Game.LambdaHack.Client.Response

data 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.

Constructors

RespUpdAtomicNoState UpdAtomic

change State by performing this atomic update

RespUpdAtomic State UpdAtomic

put the given State, which results from performing the atomic update

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

Instances
Show Response # 
Instance details

Defined in Game.LambdaHack.Client.Response

Re-exported from Game.LambdaHack.Client.ClientOptions

data ClientOptions #

Options that affect the behaviour of the client (but not game rules).

Constructors

ClientOptions 

Fields

Instances
Eq ClientOptions # 
Instance details

Defined in Game.LambdaHack.Client.ClientOptions

Show ClientOptions # 
Instance details

Defined in Game.LambdaHack.Client.ClientOptions

Generic ClientOptions # 
Instance details

Defined in Game.LambdaHack.Client.ClientOptions

Associated Types

type Rep ClientOptions :: * -> * #

Binary ClientOptions # 
Instance details

Defined in Game.LambdaHack.Client.ClientOptions

type Rep ClientOptions # 
Instance details

Defined in Game.LambdaHack.Client.ClientOptions

type Rep ClientOptions = D1 (MetaData "ClientOptions" "Game.LambdaHack.Client.ClientOptions" "LambdaHack-0.8.3.0-1hn0NFDS4ux6qD3ggO7yse" False) (C1 (MetaCons "ClientOptions" PrefixI True) ((((S1 (MetaSel (Just "sgtkFontFamily") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe Text)) :*: S1 (MetaSel (Just "sdlFontFile") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 (MetaSel (Just "sdlTtfSizeAdd") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe Int)) :*: (S1 (MetaSel (Just "sdlFonSizeAdd") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe Int)) :*: S1 (MetaSel (Just "sfontSize") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe Int))))) :*: ((S1 (MetaSel (Just "scolorIsBold") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe Bool)) :*: (S1 (MetaSel (Just "slogPriority") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe Int)) :*: S1 (MetaSel (Just "smaxFps") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe Int)))) :*: (S1 (MetaSel (Just "sdisableAutoYes") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool) :*: (S1 (MetaSel (Just "snoAnim") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 (MetaSel (Just "snewGameCli") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool))))) :*: (((S1 (MetaSel (Just "sbenchmark") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool) :*: S1 (MetaSel (Just "stitle") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 (MetaSel (Just "sfontDir") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe FilePath)) :*: (S1 (MetaSel (Just "ssavePrefixCli") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 String) :*: S1 (MetaSel (Just "sfrontendTeletype") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool)))) :*: ((S1 (MetaSel (Just "sfrontendNull") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool) :*: (S1 (MetaSel (Just "sfrontendLazy") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool) :*: S1 (MetaSel (Just "sdbgMsgCli") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool))) :*: (S1 (MetaSel (Just "sstopAfterSeconds") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe Int)) :*: (S1 (MetaSel (Just "sstopAfterFrames") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 (Maybe Int)) :*: S1 (MetaSel (Just "sprintEachScreen") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool)))))))

defClientOptions :: ClientOptions #

Default value of client options.

Re-exported from Game.LambdaHack.Client.UI

data KeyKind #

Key-command mappings to be specified in content and used for the UI.

data UIOptions #

Options that affect the UI of the client.

Instances
Show UIOptions # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

Generic UIOptions # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

Associated Types

type Rep UIOptions :: * -> * #

Binary UIOptions # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

NFData UIOptions # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

Methods

rnf :: UIOptions -> () #

type Rep UIOptions # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

type Rep UIOptions = D1 (MetaData "UIOptions" "Game.LambdaHack.Client.UI.UIOptions" "LambdaHack-0.8.3.0-1hn0NFDS4ux6qD3ggO7yse" False) (C1 (MetaCons "UIOptions" PrefixI True) ((((S1 (MetaSel (Just "uCommands") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 [(KM, CmdTriple)]) :*: S1 (MetaSel (Just "uHeroNames") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 [(Int, (Text, Text))])) :*: (S1 (MetaSel (Just "uVi") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool) :*: S1 (MetaSel (Just "uLaptop") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool))) :*: ((S1 (MetaSel (Just "uGtkFontFamily") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Text) :*: S1 (MetaSel (Just "uSdlFontFile") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Text)) :*: (S1 (MetaSel (Just "uSdlTtfSizeAdd") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "uSdlFonSizeAdd") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Int)))) :*: (((S1 (MetaSel (Just "uFontSize") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "uColorIsBold") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool)) :*: (S1 (MetaSel (Just "uHistoryMax") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "uMaxFps") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Int))) :*: ((S1 (MetaSel (Just "uNoAnim") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool) :*: S1 (MetaSel (Just "uRunStopMsgs") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Bool)) :*: (S1 (MetaSel (Just "uhpWarningPercent") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 Int) :*: S1 (MetaSel (Just "uCmdline") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 [String]))))))

applyUIOptions :: COps -> UIOptions -> ClientOptions -> ClientOptions #

Modify client options with UI options.

uCmdline :: UIOptions -> [String] #

Hardwired commandline arguments to process.

mkUIOptions :: COps -> Bool -> IO UIOptions #

Read and parse UI config file.