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

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Common.MonadStateRead

Description

Game state reading monad and basic operations.

Synopsis

- class (Monad m, Functor m, Applicative m) => MonadStateRead (m :: Type -> Type) where
  - getsState :: (State -> a) -> m a
- getState :: MonadStateRead m => m State
- getLevel :: MonadStateRead m => LevelId -> m Level
- getGameMode :: MonadStateRead m => m ModeKind
- isNoConfirmsGame :: MonadStateRead m => m Bool
- getEntryArena :: MonadStateRead m => Faction -> m LevelId
- pickWeaponM :: MonadStateRead m => Bool -> Maybe DiscoveryBenefit -> [(ItemId, ItemFullKit)] -> Skills -> ActorId -> m [(Double, Bool, Int, Int, ItemId, ItemFullKit)]
- displayTaunt :: MonadStateRead m => Bool -> (Rnd (Text, Text) -> m (Text, Text)) -> ActorId -> m (Text, Text)

# Documentation

class (Monad m, Functor m, Applicative m) => MonadStateRead (m :: Type -> Type) where Source #

Monad for reading game state. A state monad with state modification disallowed (another constraint is needed to permit that). The basic server and client monads are like that, because server and clients freely modify their internal session data, but don't modify the main game state, except in very restricted and synchronized way.

Methods

getsState :: (State -> a) -> m a Source #

#### Instances

Instances details

MonadStateRead CliImplementation Source # |
Instance details Defined in Implementation.MonadClientImplementation Methods getsState :: (State -> a) -> CliImplementation a Source #
MonadStateRead SerImplementation Source # |
Instance details Defined in Implementation.MonadServerImplementation Methods getsState :: (State -> a) -> SerImplementation a Source #

getState :: MonadStateRead m => m State Source #

getLevel :: MonadStateRead m => LevelId -> m Level Source #

getGameMode :: MonadStateRead m => m ModeKind Source #

isNoConfirmsGame :: MonadStateRead m => m Bool Source #

getEntryArena :: MonadStateRead m => Faction -> m LevelId Source #

pickWeaponM :: MonadStateRead m => Bool -> Maybe DiscoveryBenefit -> [(ItemId, ItemFullKit)] -> Skills -> ActorId -> m [(Double, Bool, Int, Int, ItemId, ItemFullKit)] Source #

displayTaunt :: MonadStateRead m => Bool -> (Rnd (Text, Text) -> m (Text, Text)) -> ActorId -> m (Text, Text) Source #