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

Game.LambdaHack.Client.State

Description

Client-specific game state components.

Synopsis

Documentation

data StateClient Source #

Client state, belonging to a single faction.

Constructors

StateClient 

Fields

Instances

Instances details
Show StateClient Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Binary StateClient Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Methods

put :: StateClient -> Put

get :: Get StateClient

putList :: [StateClient] -> Put

data BfsAndPath Source #

Pathfinding distances to all reachable positions of an actor and a shortest paths to some of the positions.

Instances

Instances details
Show BfsAndPath Source # 
Instance details

Defined in Game.LambdaHack.Client.State

data TgtAndPath Source #

Actor's target and a path to it, if any.

Constructors

TgtAndPath 

Instances

Instances details
Show TgtAndPath Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Generic TgtAndPath Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Associated Types

type Rep TgtAndPath :: Type -> Type

Methods

from :: TgtAndPath -> Rep TgtAndPath x

to :: Rep TgtAndPath x -> TgtAndPath

Binary TgtAndPath Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Methods

put :: TgtAndPath -> Put

get :: Get TgtAndPath

putList :: [TgtAndPath] -> Put

type Rep TgtAndPath Source # 
Instance details

Defined in Game.LambdaHack.Client.State

type Rep TgtAndPath = D1 ('MetaData "TgtAndPath" "Game.LambdaHack.Client.State" "LambdaHack-0.9.5.0-IfKZ3m76YlCDhiCPrOePIo" 'False) (C1 ('MetaCons "TgtAndPath" 'PrefixI 'True) (S1 ('MetaSel ('Just "tapTgt") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Target) :*: S1 ('MetaSel ('Just "tapPath") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe AndPath))))

data Target Source #

The type of na actor target.

Constructors

TEnemy ActorId

target an enemy

TNonEnemy ActorId

target a friend or neutral

TPoint TGoal LevelId Point

target a concrete spot

TVector Vector

target position relative to actor

Instances

Instances details
Eq Target Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Methods

(==) :: Target -> Target -> Bool #

(/=) :: Target -> Target -> Bool #

Ord Target Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Show Target Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Generic Target Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Associated Types

type Rep Target :: Type -> Type

Methods

from :: Target -> Rep Target x

to :: Rep Target x -> Target

Binary Target Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Methods

put :: Target -> Put

get :: Get Target

putList :: [Target] -> Put

type Rep Target Source # 
Instance details

Defined in Game.LambdaHack.Client.State

type Rep Target = D1 ('MetaData "Target" "Game.LambdaHack.Client.State" "LambdaHack-0.9.5.0-IfKZ3m76YlCDhiCPrOePIo" 'False) ((C1 ('MetaCons "TEnemy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ActorId)) :+: C1 ('MetaCons "TNonEnemy" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ActorId))) :+: (C1 ('MetaCons "TPoint" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 TGoal) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 LevelId) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Point))) :+: C1 ('MetaCons "TVector" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Vector))))

data TGoal Source #

The goal of an actor.

Constructors

TEnemyPos ActorId

last seen position of the targeted actor

TEmbed ItemBag Point

embedded item that can be triggered; in TPoint (TEmbed bag p) _ q usually bag is embbedded in p and q is an adjacent open tile

TItem ItemBag

item lying on the ground

TSmell

smell potentially left by enemies

TBlock

a blocking tile to be approached (and, e.g., revealed to be walkable or altered or searched)

TUnknown

an unknown tile to be explored

TKnown

a known tile to be patrolled

Instances

Instances details
Eq TGoal Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Methods

(==) :: TGoal -> TGoal -> Bool #

(/=) :: TGoal -> TGoal -> Bool #

Ord TGoal Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Methods

compare :: TGoal -> TGoal -> Ordering #

(<) :: TGoal -> TGoal -> Bool #

(<=) :: TGoal -> TGoal -> Bool #

(>) :: TGoal -> TGoal -> Bool #

(>=) :: TGoal -> TGoal -> Bool #

max :: TGoal -> TGoal -> TGoal #

min :: TGoal -> TGoal -> TGoal #

Show TGoal Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Methods

showsPrec :: Int -> TGoal -> ShowS #

show :: TGoal -> String #

showList :: [TGoal] -> ShowS #

Generic TGoal Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Associated Types

type Rep TGoal :: Type -> Type

Methods

from :: TGoal -> Rep TGoal x

to :: Rep TGoal x -> TGoal

Binary TGoal Source # 
Instance details

Defined in Game.LambdaHack.Client.State

Methods

put :: TGoal -> Put

get :: Get TGoal

putList :: [TGoal] -> Put

type Rep TGoal Source # 
Instance details

Defined in Game.LambdaHack.Client.State

type Rep TGoal = D1 ('MetaData "TGoal" "Game.LambdaHack.Client.State" "LambdaHack-0.9.5.0-IfKZ3m76YlCDhiCPrOePIo" 'False) ((C1 ('MetaCons "TEnemyPos" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ActorId)) :+: (C1 ('MetaCons "TEmbed" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ItemBag) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Point)) :+: C1 ('MetaCons "TItem" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ItemBag)))) :+: ((C1 ('MetaCons "TSmell" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TBlock" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "TUnknown" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "TKnown" 'PrefixI 'False) (U1 :: Type -> Type))))

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.