Safe Haskell | None |
---|
Server and client game state types and operations.
- data State
- sdungeon :: State -> Dungeon
- sdepth :: State -> Int
- sactorD :: State -> ActorDict
- sitemD :: State -> ItemDict
- sfactionD :: State -> FactionDict
- stime :: State -> Time
- scops :: State -> COps
- shigh :: State -> ScoreTable
- defStateGlobal :: Dungeon -> Int -> FactionDict -> COps -> ScoreTable -> State
- emptyState :: State
- localFromGlobal :: State -> State
- updateDungeon :: (Dungeon -> Dungeon) -> State -> State
- updateDepth :: (Int -> Int) -> State -> State
- updateActorD :: (ActorDict -> ActorDict) -> State -> State
- updateItemD :: (ItemDict -> ItemDict) -> State -> State
- updateFaction :: (FactionDict -> FactionDict) -> State -> State
- updateTime :: (Time -> Time) -> State -> State
- updateCOps :: (COps -> COps) -> State -> State
- getLocalTime :: LevelId -> State -> Time
- isHumanFaction :: FactionId -> State -> Bool
- usesAIFaction :: FactionId -> State -> Bool
- isSpawnFaction :: FactionId -> State -> Bool
- isSummonFaction :: FactionId -> State -> Bool
Basic game state, local or global
View on game state. Remembered fields carry a subset of the info
in the client copies of the state. Clients never directly change
their State
, but apply atomic actions sent by the server to do so.
State components
sfactionD :: State -> FactionDictSource
shigh :: State -> ScoreTableSource
State operations
defStateGlobal :: Dungeon -> Int -> FactionDict -> COps -> ScoreTable -> StateSource
Initial complete global game state.
Initial empty state.
localFromGlobal :: State -> StateSource
Local state created by removing secret information from global state components.
updateFaction :: (FactionDict -> FactionDict) -> State -> StateSource
Update faction data within state.
getLocalTime :: LevelId -> State -> TimeSource
Get current time from the dungeon data.
isHumanFaction :: FactionId -> State -> BoolSource
Tell whether the faction is controlled (at least partially) by a human.
usesAIFaction :: FactionId -> State -> BoolSource
Tell whether the faction uses AI to control any of its actors.
isSpawnFaction :: FactionId -> State -> BoolSource
Tell whether the faction can spawn actors.
isSummonFaction :: FactionId -> State -> BoolSource
Tell whether actors of the faction can be summoned by items, etc..