Safe Haskell | None |
---|---|
Language | Haskell2010 |
Game.LambdaHack.Client.State
Description
Client-specific game state components.
Synopsis
- data StateClient = StateClient {
- seps :: Int
- stargetD :: EnumMap ActorId TgtAndPath
- sfleeD :: EnumMap ActorId (Point, Time)
- sexplored :: EnumSet LevelId
- sbfsD :: EnumMap ActorId BfsAndPath
- sundo :: ()
- sdiscoBenefit :: DiscoveryBenefit
- sfper :: PerLid
- salter :: AlterLid
- srandom :: SMGen
- _sleader :: Maybe ActorId
- _sside :: FactionId
- squit :: Bool
- scondInMelee :: EnumSet LevelId
- soptions :: ClientOptions
- stabs :: (PrimArray PointI, PrimArray PointI)
- scurChal :: Challenge
- snxtChal :: Challenge
- smarkSuspect :: Int
- type AlterLid = EnumMap LevelId (Array Word8)
- data BfsAndPath
- data TgtAndPath = TgtAndPath {}
- data Target
- data TGoal
- emptyStateClient :: FactionId -> StateClient
- cycleMarkSuspect :: Int -> StateClient -> StateClient
- updateTarget :: ActorId -> (Maybe Target -> Maybe Target) -> StateClient -> StateClient
- getTarget :: ActorId -> StateClient -> Maybe Target
- updateLeader :: ActorId -> State -> StateClient -> StateClient
- sside :: StateClient -> FactionId
- sleader :: StateClient -> Maybe ActorId
Documentation
data StateClient Source #
Client state, belonging to a single faction.
Constructors
StateClient | |
Fields
|
Instances
Binary StateClient Source # | |
Defined in Game.LambdaHack.Client.State |
data BfsAndPath Source #
Pathfinding distances to all reachable positions of an actor and a shortest paths to some of the positions.
Constructors
BfsInvalid | |
BfsAndPath (Array BfsDistance) (EnumMap Point AndPath) |
Instances
Show BfsAndPath Source # | |
Defined in Game.LambdaHack.Client.State Methods showsPrec :: Int -> BfsAndPath -> ShowS # show :: BfsAndPath -> String # showList :: [BfsAndPath] -> ShowS # |
data TgtAndPath Source #
Actor's target and a path to it, if any.
Instances
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
Binary Target Source # | |||||
Generic Target Source # | |||||
Defined in Game.LambdaHack.Client.State Associated Types
| |||||
Show Target Source # | |||||
Eq Target Source # | |||||
type Rep Target Source # | |||||
Defined in Game.LambdaHack.Client.State type Rep Target = D1 ('MetaData "Target" "Game.LambdaHack.Client.State" "LambdaHack-0.11.0.1-1D7LX8pdduC5BWPZZbOgrs" '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)))) |
The goal of an actor.
Constructors
TStash FactionId | shared inventory stash of our or an enemy faction |
TEnemyPos ActorId | last seen position of the targeted actor |
TEmbed ItemBag Point | embedded item that can be triggered;
in |
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 |
THideout | a hideout to either flee to or find a hidden enemy sniper in |
Instances
Binary TGoal Source # | |||||
Generic TGoal Source # | |||||
Defined in Game.LambdaHack.Client.State Associated Types
| |||||
Show TGoal Source # | |||||
Eq TGoal Source # | |||||
type Rep TGoal Source # | |||||
Defined in Game.LambdaHack.Client.State type Rep TGoal = D1 ('MetaData "TGoal" "Game.LambdaHack.Client.State" "LambdaHack-0.11.0.1-1D7LX8pdduC5BWPZZbOgrs" 'False) (((C1 ('MetaCons "TStash" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 FactionId)) :+: 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) :+: C1 ('MetaCons "THideout" 'PrefixI 'False) (U1 :: Type -> Type))))) |
emptyStateClient :: FactionId -> StateClient Source #
Initial empty game client state.
cycleMarkSuspect :: Int -> StateClient -> StateClient Source #
Cycle the smarkSuspect
setting.
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.
sside :: StateClient -> FactionId Source #