Safe Haskell | None |
---|---|
Language | Haskell2010 |
Client monad for interacting with a human through UI.
Synopsis
- class MonadClientRead m => MonadClientUI m where
- getsSession :: (SessionUI -> a) -> m a
- modifySession :: (SessionUI -> SessionUI) -> m ()
- updateClientLeader :: ActorId -> m ()
- getCacheBfs :: ActorId -> m (Array BfsDistance)
- getCachePath :: ActorId -> Point -> m (Maybe AndPath)
- clientPrintUI :: MonadClientUI m => Text -> m ()
- debugPossiblyPrintUI :: MonadClientUI m => Text -> m ()
- getSession :: MonadClientUI m => m SessionUI
- putSession :: MonadClientUI m => SessionUI -> m ()
- displayFrames :: MonadClientUI m => LevelId -> PreFrames3 -> m ()
- connFrontendFrontKey :: MonadClientUI m => [KM] -> PreFrame3 -> m KM
- setFrontAutoYes :: MonadClientUI m => Bool -> m ()
- frontendShutdown :: MonadClientUI m => m ()
- printScreen :: MonadClientUI m => m ()
- chanFrontend :: MonadClientUI m => ScreenContent -> ClientOptions -> m ChanFrontend
- anyKeyPressed :: MonadClientUI m => m Bool
- discardPressedKey :: MonadClientUI m => m ()
- resetPressedKeys :: MonadClientUI m => m ()
- addPressedControlEsc :: MonadClientUI m => m ()
- revCmdMap :: MonadClientUI m => m (HumanCmd -> KM)
- getReportUI :: MonadClientUI m => Bool -> m Report
- computeChosenLore :: MonadClientUI m => m ([(ActorId, Actor)], [(ItemId, ItemQuant)])
- miniHintAimingBare :: Text
- miniHintAimingLore :: Text
- getLeaderUI :: MonadClientUI m => m ActorId
- getArenaUI :: MonadClientUI m => m LevelId
- viewedLevelUI :: MonadClientUI m => m LevelId
- xhairToPos :: MonadClientUI m => m (Maybe Point)
- setXHairFromGUI :: MonadClientUI m => Maybe Target -> m ()
- clearAimMode :: MonadClientUI m => m ()
- getFontSetup :: MonadClientUI m => m FontSetup
- scoreToSlideshow :: MonadClientUI m => Int -> Status -> m Slideshow
- defaultHistory :: (MonadClient m, MonadClientUI m) => m History
- tellAllClipPS :: MonadClientUI m => m ()
- tellGameClipPS :: MonadClientUI m => m ()
- elapsedSessionTimeGT :: MonadClientUI m => Int -> m Bool
- resetSessionStart :: MonadClientUI m => m ()
- resetGameStart :: MonadClientUI m => m ()
- partActorLeader :: MonadClientUI m => ActorId -> m Part
- partPronounLeader :: MonadClientUI m => ActorId -> m Part
- tryRestore :: MonadClientUI m => m (Maybe (StateClient, Maybe SessionUI))
- leaderSkillsClientUI :: MonadClientUI m => m Skills
- rndToActionUI :: MonadClientUI m => Rnd a -> m a
- tryOpenBrowser :: MonadClientUI m => String -> m Bool
- connFrontend :: MonadClientUI m => FrontReq a -> m a
- displayFrame :: MonadClientUI m => Maybe Frame -> m ()
- addPressedKey :: MonadClientUI m => KMP -> m ()
Client UI monad
class MonadClientRead m => MonadClientUI m where Source #
The monad that gives the client access to UI operations, but not to modifying client state.
getsSession :: (SessionUI -> a) -> m a Source #
modifySession :: (SessionUI -> SessionUI) -> m () Source #
updateClientLeader :: ActorId -> m () Source #
getCacheBfs :: ActorId -> m (Array BfsDistance) Source #
getCachePath :: ActorId -> Point -> m (Maybe AndPath) Source #
Instances
MonadClientUI CliImplementation Source # | |
Defined in Implementation.MonadClientImplementation getsSession :: (SessionUI -> a) -> CliImplementation a Source # modifySession :: (SessionUI -> SessionUI) -> CliImplementation () Source # updateClientLeader :: ActorId -> CliImplementation () Source # getCacheBfs :: ActorId -> CliImplementation (Array BfsDistance) Source # getCachePath :: ActorId -> Point -> CliImplementation (Maybe AndPath) Source # |
Assorted primitives
clientPrintUI :: MonadClientUI m => Text -> m () Source #
debugPossiblyPrintUI :: MonadClientUI m => Text -> m () Source #
getSession :: MonadClientUI m => m SessionUI Source #
putSession :: MonadClientUI m => SessionUI -> m () Source #
displayFrames :: MonadClientUI m => LevelId -> PreFrames3 -> m () Source #
Push frames or delays to the frame queue. The frames depict
the lid
level.
connFrontendFrontKey :: MonadClientUI m => [KM] -> PreFrame3 -> m KM Source #
Write FrontKey
UI request to the frontend, read the reply,
set pointer, return key.
setFrontAutoYes :: MonadClientUI m => Bool -> m () Source #
frontendShutdown :: MonadClientUI m => m () Source #
printScreen :: MonadClientUI m => m () Source #
chanFrontend :: MonadClientUI m => ScreenContent -> ClientOptions -> m ChanFrontend Source #
Initialize the frontend chosen by the player via client options.
anyKeyPressed :: MonadClientUI m => m Bool Source #
discardPressedKey :: MonadClientUI m => m () Source #
resetPressedKeys :: MonadClientUI m => m () Source #
addPressedControlEsc :: MonadClientUI m => m () Source #
getReportUI :: MonadClientUI m => Bool -> m Report Source #
computeChosenLore :: MonadClientUI m => m ([(ActorId, Actor)], [(ItemId, ItemQuant)]) Source #
getLeaderUI :: MonadClientUI m => m ActorId Source #
getArenaUI :: MonadClientUI m => m LevelId Source #
viewedLevelUI :: MonadClientUI m => m LevelId Source #
xhairToPos :: MonadClientUI m => m (Maybe Point) Source #
setXHairFromGUI :: MonadClientUI m => Maybe Target -> m () Source #
clearAimMode :: MonadClientUI m => m () Source #
getFontSetup :: MonadClientUI m => m FontSetup Source #
scoreToSlideshow :: MonadClientUI m => Int -> Status -> m Slideshow Source #
defaultHistory :: (MonadClient m, MonadClientUI m) => m History Source #
tellAllClipPS :: MonadClientUI m => m () Source #
tellGameClipPS :: MonadClientUI m => m () Source #
elapsedSessionTimeGT :: MonadClientUI m => Int -> m Bool Source #
resetSessionStart :: MonadClientUI m => m () Source #
resetGameStart :: MonadClientUI m => m () Source #
partActorLeader :: MonadClientUI m => ActorId -> m Part Source #
The part of speech describing the actor or the "you" pronoun if he is the leader of the observer's faction.
partPronounLeader :: MonadClientUI m => ActorId -> m Part Source #
The part of speech with the actor's pronoun or "you" if a leader of the client's faction.
tryRestore :: MonadClientUI m => m (Maybe (StateClient, Maybe SessionUI)) Source #
Try to read saved client game state from the file system.
leaderSkillsClientUI :: MonadClientUI m => m Skills Source #
rndToActionUI :: MonadClientUI m => Rnd a -> m a Source #
Invoke pseudo-random computation with the generator kept in the session.
tryOpenBrowser :: MonadClientUI m => String -> m Bool Source #
Internal operations
connFrontend :: MonadClientUI m => FrontReq a -> m a Source #
Write a UI request to the frontend and read a corresponding reply.
displayFrame :: MonadClientUI m => Maybe Frame -> m () Source #
addPressedKey :: MonadClientUI m => KMP -> m () Source #