LambdaHack-0.11.0.0: A game engine library for tactical squad ASCII roguelike dungeon crawlers
Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Client

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) => CCUI -> UIOptions -> ClientOptions -> Bool -> 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

Instances details
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 ReqUI Source #

Possible forms of requests sent by UI clients.

Instances

Instances details
Show ReqUI Source # 
Instance details

Defined in Game.LambdaHack.Client.Request

Methods

showsPrec :: Int -> ReqUI -> ShowS #

show :: ReqUI -> String #

showList :: [ReqUI] -> ShowS #

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

RespQueryUIunderAI

check if the UI client wants to regain control

RespQueryUI

prompt the human player for a command and send (the semantics of) it

Instances

Instances details
Show Response Source # 
Instance details

Defined in Game.LambdaHack.Client.Response

Re-exported from Game.LambdaHack.Client.UI

data CCUI Source #

Operations for all UI content types, gathered together.

data UIOptions Source #

Options that affect the UI of the client, specified in the config file. More documentation is in the default config file.

Instances

Instances details
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 :: Type -> Type #

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.11.0.0-inplace" '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 "uLeftHand") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))) :*: ((S1 ('MetaSel ('Just "uChosenFontset") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "uAllFontsScale") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double)) :*: (S1 ('MetaSel ('Just "uFullscreenMode") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FullscreenMode) :*: S1 ('MetaSel ('Just "uhpWarningPercent") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))) :*: (((S1 ('MetaSel ('Just "uMsgWrapColumn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 X) :*: S1 ('MetaSel ('Just "uHistoryMax") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "uMaxFps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Double) :*: S1 ('MetaSel ('Just "uNoAnim") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))) :*: ((S1 ('MetaSel ('Just "uOverrideCmdline") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [String]) :*: S1 ('MetaSel ('Just "uFonts") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(Text, FontDefinition)])) :*: (S1 ('MetaSel ('Just "uFontsets") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(Text, FontSet)]) :*: S1 ('MetaSel ('Just "uMessageColors") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 [(String, Color)]))))))

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

Modify client options with UI options.

mkUIOptions :: RuleContent -> ClientOptions -> IO UIOptions Source #

Read and parse UI config file.