Safe Haskell | None |
---|---|
Language | Haskell2010 |
Server and client game state types and operations.
- data StateClient = StateClient {
- seps :: Int
- stargetD :: EnumMap ActorId TgtAndPath
- sexplored :: EnumSet LevelId
- sbfsD :: EnumMap ActorId BfsAndPath
- sundo :: [CmdAtomic]
- sdiscoKind :: DiscoveryKind
- sdiscoAspect :: DiscoveryAspect
- sdiscoBenefit :: DiscoveryBenefit
- sactorAspect :: ActorAspect
- sfper :: PerLid
- salter :: AlterLid
- srandom :: StdGen
- _sleader :: Maybe ActorId
- _sside :: FactionId
- squit :: Bool
- scurChal :: Challenge
- snxtChal :: Challenge
- snxtScenario :: Int
- smarkSuspect :: Int
- scondInMelee :: EnumMap LevelId (Maybe Bool)
- svictories :: EnumMap (Id ModeKind) (Map Challenge Int)
- sdebugCli :: DebugModeCli
- emptyStateClient :: FactionId -> StateClient
- type AlterLid = EnumMap LevelId (Array Word8)
- updateTarget :: ActorId -> (Maybe Target -> Maybe Target) -> StateClient -> StateClient
- getTarget :: ActorId -> StateClient -> Maybe Target
- updateLeader :: ActorId -> State -> StateClient -> StateClient
- sside :: StateClient -> FactionId
- data BfsAndPath
- = BfsInvalid
- | BfsAndPath { }
- data TgtAndPath = TgtAndPath {}
- cycleMarkSuspect :: 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.
When many actors want to fling at the same target, they set their personal targets to follow the common xhair. When each wants to kill a fleeing enemy they recently meleed, they keep the enemies as their personal targets.
Data invariant: if _sleader
is Nothing
then so is srunning
.
StateClient | |
|
emptyStateClient :: FactionId -> StateClient Source #
Initial empty game client state.
updateTarget :: ActorId -> (Maybe Target -> Maybe Target) -> StateClient -> StateClient Source #
Update target parameters within client state.
getTarget :: ActorId -> StateClient -> Maybe Target Source #
Get target parameters from client state.
updateLeader :: ActorId -> State -> StateClient -> StateClient Source #
Update picked leader within state. Verify actor's faction.
sside :: StateClient -> FactionId Source #
data BfsAndPath Source #
data TgtAndPath Source #