Safe Haskell | None |
---|---|
Language | Haskell2010 |
Server and client game state types and operations.
- data StateClient = StateClient {
- stgtMode :: !(Maybe TgtMode)
- scursor :: !Target
- seps :: !Int
- stargetD :: !(EnumMap ActorId (Target, Maybe PathEtc))
- sexplored :: !(EnumSet LevelId)
- sbfsD :: !(EnumMap ActorId (Bool, Array BfsDistance, Point, Int, Maybe [Point]))
- sselected :: !(EnumSet ActorId)
- srunning :: !(Maybe RunParams)
- sreport :: !Report
- shistory :: !History
- sdisplayed :: !(EnumMap LevelId Time)
- sundo :: ![CmdAtomic]
- sdiscoKind :: !DiscoveryKind
- sdiscoEffect :: !DiscoveryEffect
- sfper :: !FactionPers
- srandom :: !StdGen
- slastKM :: !KM
- slastRecord :: !LastRecord
- slastPlay :: ![KM]
- slastLost :: !(EnumSet ActorId)
- swaitTimes :: !Int
- _sleader :: !(Maybe ActorId)
- _sside :: !FactionId
- squit :: !Bool
- sisAI :: !Bool
- smarkVision :: !Bool
- smarkSmell :: !Bool
- smarkSuspect :: !Bool
- scurDifficulty :: !Int
- sslots :: !ItemSlots
- slastSlot :: !SlotChar
- slastStore :: !CStore
- sescAI :: !EscAI
- sdebugCli :: !DebugModeCli
- defStateClient :: History -> Report -> FactionId -> Bool -> StateClient
- defaultHistory :: IO History
- updateTarget :: ActorId -> (Maybe Target -> Maybe Target) -> StateClient -> StateClient
- getTarget :: ActorId -> StateClient -> Maybe Target
- updateLeader :: ActorId -> State -> StateClient -> StateClient
- sside :: StateClient -> FactionId
- type PathEtc = ([Point], (Point, Int))
- newtype TgtMode = TgtMode {}
- data RunParams = RunParams {
- runLeader :: !ActorId
- runMembers :: ![ActorId]
- runInitial :: !Bool
- runStopMsg :: !(Maybe Text)
- runWaiting :: !Int
- type LastRecord = ([KM], [KM], Int)
- data EscAI
- toggleMarkVision :: StateClient -> StateClient
- toggleMarkSmell :: StateClient -> StateClient
- toggleMarkSuspect :: StateClient -> StateClient
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.
Data invariant: if _sleader
is Nothing
then so is srunning
.
StateClient | |
|
defStateClient :: History -> Report -> FactionId -> Bool -> StateClient Source
Initial game client state.
updateTarget :: ActorId -> (Maybe Target -> Maybe Target) -> StateClient -> StateClient Source
Update target parameters within client state.
updateLeader :: ActorId -> State -> StateClient -> StateClient Source
Update picked leader within state. Verify actor's faction.
sside :: StateClient -> FactionId Source
Current targeting mode of a client.
Parameters of the current run.
RunParams | |
|
type LastRecord = ([KM], [KM], Int) Source