LambdaHack-0.6.2.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Client.State

Description

Server and client game state types and operations.

Synopsis

Documentation

data StateClient Source #

Client state, belonging to a single faction. Some of the data, e.g, the history, carries over from game to game, even across playing sessions.

When many actors want to fling at the same target, they set their personal targets to follow the common xhair. When each wants to kill a fleeing enemy they recently meleed, they keep the enemies as their personal targets.

Data invariant: if _sleader is Nothing then so is srunning.

Constructors

StateClient 

Fields

emptyStateClient :: FactionId -> StateClient Source #

Initial empty game client state.

updateTarget :: ActorId -> (Maybe Target -> Maybe Target) -> StateClient -> StateClient Source #

Update target parameters within client state.

getTarget :: ActorId -> StateClient -> Maybe Target Source #

Get target parameters from client state.

updateLeader :: ActorId -> State -> StateClient -> StateClient Source #

Update picked leader within state. Verify actor's faction.

data TgtAndPath Source #

Constructors

TgtAndPath 

Fields

Instances

Show TgtAndPath Source # 
Generic TgtAndPath Source # 

Associated Types

type Rep TgtAndPath :: * -> * #

Binary TgtAndPath Source # 
type Rep TgtAndPath Source # 
type Rep TgtAndPath = D1 * (MetaData "TgtAndPath" "Game.LambdaHack.Client.State" "LambdaHack-0.6.2.0-6LvAjp6yuzE4Q9dWwe00a" False) (C1 * (MetaCons "TgtAndPath" PrefixI True) ((:*:) * (S1 * (MetaSel (Just Symbol "tapTgt") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * Target)) (S1 * (MetaSel (Just Symbol "tapPath") NoSourceUnpackedness NoSourceStrictness DecidedStrict) (Rec0 * AndPath))))