Safe Haskell | None |
---|---|

Language | Haskell2010 |

Game state reading monad and basic operations.

- class (Monad m, Functor m, Applicative m) => MonadStateRead m where
- getState :: MonadStateRead m => m State
- getLevel :: MonadStateRead m => LevelId -> m Level
- nUI :: MonadStateRead m => m Int
- getGameMode :: MonadStateRead m => m ModeKind
- isNoConfirmsGame :: MonadStateRead m => m Bool
- getEntryArena :: MonadStateRead m => Faction -> m LevelId
- pickWeaponM :: MonadStateRead m => Maybe DiscoveryBenefit -> [(ItemId, ItemFull)] -> Skills -> ActorId -> m [(Double, (ItemId, ItemFull))]

# Documentation

class (Monad m, Functor m, Applicative m) => MonadStateRead m 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.

getState :: MonadStateRead m => m State Source #

nUI :: MonadStateRead m => m Int Source #

getGameMode :: MonadStateRead m => m ModeKind Source #

isNoConfirmsGame :: MonadStateRead m => m Bool Source #

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

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