LambdaHack-0.8.1.1: 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 () 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.

data ReqAI Source #

Possible forms of requests sent by AI clients.

Instances
Show ReqAI Source # 
Instance details

Defined in Game.LambdaHack.Client.Request

Methods

showsPrec :: Int -> ReqAI -> ShowS #

show :: ReqAI -> String #

showList :: [ReqAI] -> ShowS #

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.

data RequestAnyAbility Source #

Basic form of requests, sent by both AI and UI clients to the server.

data RequestTimed :: Ability -> * where Source #

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

Instances
Show (RequestTimed a) Source # 
Instance details

Defined in Game.LambdaHack.Client.Request

Re-exported from Game.LambdaHack.Client.Response

data Response Source #

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 Source # 
Instance details

Defined in Game.LambdaHack.Client.Response

Re-exported from Game.LambdaHack.Client.ClientOptions

data ClientOptions Source #

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

Instances
Eq ClientOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.ClientOptions

Show ClientOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.ClientOptions

Generic ClientOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.ClientOptions

Associated Types

type Rep ClientOptions :: * -> * #

Binary ClientOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.ClientOptions

type Rep ClientOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.ClientOptions

type Rep ClientOptions = D1 (MetaData "ClientOptions" "Game.LambdaHack.Client.ClientOptions" "LambdaHack-0.8.1.1-B7gvMzZweCFaQcfmLNwOP" 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 Source #

Default value of client options.

sbenchmark :: ClientOptions -> Bool Source #

Don't create directories and files and show time stats.

Re-exported from Game.LambdaHack.Client.UI

data KeyKind Source #

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

data UIOptions Source #

Options that affect the UI of the client.

Instances
Show UIOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

Generic UIOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

Associated Types

type Rep UIOptions :: * -> * #

Binary UIOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

NFData UIOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

Methods

rnf :: UIOptions -> () #

type Rep UIOptions Source # 
Instance details

Defined in Game.LambdaHack.Client.UI.UIOptions

type Rep UIOptions = D1 (MetaData "UIOptions" "Game.LambdaHack.Client.UI.UIOptions" "LambdaHack-0.8.1.1-B7gvMzZweCFaQcfmLNwOP" 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 Source #

Modify client options with UI options.

uCmdline :: UIOptions -> [String] Source #

Hardwired commandline arguments to process.

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

Read and parse UI config file.