LambdaHack-0.11.0.1: A game engine library for tactical squad ASCII roguelike dungeon crawlers

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Server.State

Description

Server and client game state types and operations.

Synopsis

- data StateServer = StateServer {
  - sactorTime :: ActorTime
  - strajTime :: ActorTime
  - strajPushedBy :: ActorPushedBy
  - steamGear :: GearOfTeams
  - steamGearCur :: GearOfTeams
  - stcounter :: EnumMap TeamContinuity Int
  - sfactionAn :: FactionAnalytics
  - sactorAn :: ActorAnalytics
  - sgenerationAn :: GenerationAnalytics
  - sactorStasis :: EnumSet ActorId
  - sdiscoKindRev :: DiscoveryKindRev
  - suniqueSet :: UniqueSet
  - sitemRev :: ItemRev
  - sflavour :: FlavourMap
  - sacounter :: ActorId
  - sicounter :: ItemId
  - snumSpawned :: EnumMap LevelId Int
  - sbandSpawned :: IntMap Int
  - sundo :: ()
  - sclientStates :: EnumMap FactionId State
  - smetaBackup :: EnumMap TeamContinuity DiscoveryKind
  - sperFid :: PerFid
  - sperValidFid :: PerValidFid
  - sperCacheFid :: PerCacheFid
  - sfovLucidLid :: FovLucidLid
  - sfovClearLid :: FovClearLid
  - sfovLitLid :: FovLitLid
  - sarenas :: EnumSet LevelId
  - svalidArenas :: Bool
  - srandom :: SMGen
  - srngs :: RNGs
  - sbreakLoop :: Bool
  - sbreakASAP :: Bool
  - swriteSave :: Bool
  - soptions :: ServerOptions
  - soptionsNxt :: ServerOptions
  }
- type ActorTime = EnumMap FactionId (EnumMap LevelId (EnumMap ActorId Time))
- type ActorPushedBy = EnumMap ActorId ActorId
- emptyStateServer :: StateServer
- updateActorTime :: FactionId -> LevelId -> ActorId -> Time -> ActorTime -> ActorTime
- lookupActorTime :: FactionId -> LevelId -> ActorId -> ActorTime -> Maybe Time
- ageActor :: FactionId -> LevelId -> ActorId -> Delta Time -> ActorTime -> ActorTime
- type GearOfTeams = EnumMap TeamContinuity (IntMap [(GroupName ItemKind, ContentId ItemKind)])

# Documentation

data StateServer Source #

State with server-specific data, including a copy of each client's basic game state, but not the server's basic state.

Constructors

StateServer |

Fields

- sactorTime :: ActorTime

  absolute times of actors next actions

- strajTime :: ActorTime

  and same for actors with trajectories

- strajPushedBy :: ActorPushedBy

  culprits for actors with trajectories

- steamGear :: GearOfTeams

  metagame persistent personal characteristics and favourite gear of each numbered continued team member

- steamGearCur :: GearOfTeams

  gear preferences to be taken into account in the current game

- stcounter :: EnumMap TeamContinuity Int

  stores next continued team character identity index number in this game

- sfactionAn :: FactionAnalytics

  various past events data for factions

- sactorAn :: ActorAnalytics

  various past events data for actors

- sgenerationAn :: GenerationAnalytics

  item creation statistics, by item lore

- sactorStasis :: EnumSet ActorId

  actors currently in time stasis, invulnerable to time warps until move

- sdiscoKindRev :: DiscoveryKindRev

  reverse map, used for item creation

- suniqueSet :: UniqueSet

  already generated unique items

- sitemRev :: ItemRev

  reverse id map, used for item creation

- sflavour :: FlavourMap

  association of flavour to item kinds

- sacounter :: ActorId

  stores next actor index

- sicounter :: ItemId

  stores next item index

- snumSpawned :: EnumMap LevelId Int

  how many spawned so far on the level

- sbandSpawned :: IntMap Int

  how many times such group spawned

- sundo :: ()
- sclientStates :: EnumMap FactionId State

  each faction state, as seen by clients

- smetaBackup :: EnumMap TeamContinuity DiscoveryKind

  discovery info for absent factions

- sperFid :: PerFid

  perception of all factions

- sperValidFid :: PerValidFid

  perception validity for all factions

- sperCacheFid :: PerCacheFid

  perception cache of all factions

- sfovLucidLid :: FovLucidLid

  ambient or shining light positions

- sfovClearLid :: FovClearLid

  clear tiles positions

- sfovLitLid :: FovLitLid

  ambient light positions

- sarenas :: EnumSet LevelId

  the set of active arenas

- svalidArenas :: Bool

  whether active arenas valid

- srandom :: SMGen

  current random generator

- srngs :: RNGs

  initial random generators

- sbreakLoop :: Bool

  exit game loop after clip's end; usually no game save follows

- sbreakASAP :: Bool

  exit game loop ASAP; usually with save

- swriteSave :: Bool

  write savegame to file after loop exit

- soptions :: ServerOptions

  current commandline options

- soptionsNxt :: ServerOptions

  options for the next game

#### Instances

Instances details

Binary StateServer Source # |
Instance details Defined in Game.LambdaHack.Server.State Methods put :: StateServer -> Put Source # get :: Get StateServer Source # putList :: [StateServer] -> Put Source #
Show StateServer Source # |
Instance details Defined in Game.LambdaHack.Server.State Methods showsPrec :: Int -> StateServer -> ShowS Source # show :: StateServer -> String Source # showList :: [StateServer] -> ShowS Source #

type ActorTime = EnumMap FactionId (EnumMap LevelId (EnumMap ActorId Time)) Source #

Position in time for each actor, grouped by level and by faction.

type ActorPushedBy = EnumMap ActorId ActorId Source #

Record who last propelled a given actor with trajectory.

emptyStateServer :: StateServer Source #

Initial, empty game server state.

updateActorTime :: FactionId -> LevelId -> ActorId -> Time -> ActorTime -> ActorTime Source #

lookupActorTime :: FactionId -> LevelId -> ActorId -> ActorTime -> Maybe Time Source #

ageActor :: FactionId -> LevelId -> ActorId -> Delta Time -> ActorTime -> ActorTime Source #

type GearOfTeams = EnumMap TeamContinuity (IntMap [(GroupName ItemKind, ContentId ItemKind)]) Source #

Per-team, per-actor metagame persistent favourite organs and gear.