Safe Haskell | None |
---|
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 (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
- slastRecord :: !LastRecord
- slastPlay :: ![KM]
- swaitTimes :: !Int
- _sleader :: !(Maybe ActorId)
- _sside :: !FactionId
- squit :: !Bool
- sisAI :: !Bool
- smarkVision :: !Bool
- smarkSmell :: !Bool
- smarkSuspect :: !Bool
- scurDifficulty :: !Int
- sslots :: !ItemSlots
- slastSlot :: !SlotChar
- sgameMode :: !GroupName
- 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]
- runDist :: !Int
- runStopMsg :: !(Maybe Text)
- runInitDir :: !(Maybe Vector)
- type LastRecord = ([KM], [KM], Int)
- 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 -> StateClientSource
Initial game client state.
updateTarget :: ActorId -> (Maybe Target -> Maybe Target) -> StateClient -> StateClientSource
Update target parameters within client state.
updateLeader :: ActorId -> State -> StateClient -> StateClientSource
Update picked leader within state. Verify actor's faction.
sside :: StateClient -> FactionIdSource
Current targeting mode of a client.
Parameters of the current run.
RunParams | |
|
type LastRecord = ([KM], [KM], Int)Source