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

Language | Haskell2010 |

Game state reading monad and basic operations.

## Synopsis

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

## Instances

MonadStateRead CliImplementation Source # | |

Defined in Implementation.MonadClientImplementation getsState :: (State -> a) -> CliImplementation a Source # | |

MonadStateRead SerImplementation Source # | |

Defined in Implementation.MonadServerImplementation getsState :: (State -> a) -> SerImplementation a Source # |

getState :: MonadStateRead m => m State 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, (Int, (ItemId, ItemFullKit)))] Source #