Safe Haskell | None |
---|
Server and client game state types and operations.
- data StateClient = StateClient {
- stgtMode :: !(Maybe TgtMode)
- scursor :: !(Maybe Point)
- seps :: !Int
- stargetD :: !(EnumMap ActorId Target)
- srunning :: !(Maybe (Vector, Int))
- sreport :: !Report
- shistory :: !History
- sundo :: ![Atomic]
- sdisco :: !Discovery
- sfper :: !FactionPers
- srandom :: !StdGen
- sconfigUI :: !ConfigUI
- slastKey :: !(Maybe KM)
- _sleader :: !(Maybe ActorId)
- _sside :: !FactionId
- squit :: !Bool
- sisAI :: !Bool
- smarkVision :: !Bool
- smarkSmell :: !Bool
- smarkSuspect :: !Bool
- sdebugCli :: !Bool
- defStateClient :: History -> ConfigUI -> FactionId -> Bool -> StateClient
- defHistory :: IO History
- updateTarget :: ActorId -> (Maybe Target -> Maybe Target) -> StateClient -> StateClient
- getTarget :: ActorId -> StateClient -> Maybe Target
- updateLeader :: ActorId -> State -> StateClient -> StateClient
- sside :: StateClient -> FactionId
- data TgtMode
- = TgtExplicit {
- tgtLevelId :: !LevelId
- | TgtAuto {
- tgtLevelId :: !LevelId
- = TgtExplicit {
- data Target
- 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 -> ConfigUI -> 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 selected actor within state. Verify actor's faction.
sside :: StateClient -> FactionIdSource
Current targeting mode of a client.
TgtExplicit | the player requested targeting mode explicitly |
| |
TgtAuto | the mode was entered (and will be exited) automatically |
|
The type of na actor target.