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

Safe Haskell | None
Language | Haskell2010

Game.LambdaHack.Client.MonadClient

Contents

- Basic client monads
- Assorted primitives

Description

Basic client monad and related operations.

Synopsis

- class MonadStateRead m => MonadClientRead (m :: Type -> Type) where
  - getsClient :: (StateClient -> a) -> m a
  - liftIO :: IO a -> m a
- class MonadClientRead m => MonadClient (m :: Type -> Type) where
  - modifyClient :: (StateClient -> StateClient) -> m ()
- getClient :: MonadClientRead m => m StateClient
- putClient :: MonadClient m => StateClient -> m ()
- debugPossiblyPrint :: MonadClient m => Text -> m ()
- createTabBFS :: MonadClient m => m (PrimArray PointI)
- dumpTextFile :: MonadClientRead m => Text -> FilePath -> m FilePath
- rndToAction :: MonadClient m => Rnd a -> m a
- condInMeleeM :: MonadClientRead m => LevelId -> m Bool
- insertInMeleeM :: MonadClient m => LevelId -> m ()

# Basic client monads

class MonadStateRead m => MonadClientRead (m :: Type -> Type) where Source #

Monad for reading client state.

Methods

getsClient :: (StateClient -> a) -> m a Source #

liftIO :: IO a -> m a Source #

#### Instances

Instances details

MonadClientRead CliImplementation Source # |
Instance details Defined in Implementation.MonadClientImplementation Methods getsClient :: (StateClient -> a) -> CliImplementation a Source # liftIO :: IO a -> CliImplementation a Source #

class MonadClientRead m => MonadClient (m :: Type -> Type) where Source #

Monad for writing to client state.

Methods

modifyClient :: (StateClient -> StateClient) -> m () Source #

#### Instances

Instances details

MonadClient CliImplementation Source # |
Instance details Defined in Implementation.MonadClientImplementation Methods modifyClient :: (StateClient -> StateClient) -> CliImplementation () Source #

# Assorted primitives

getClient :: MonadClientRead m => m StateClient Source #

putClient :: MonadClient m => StateClient -> m () Source #

debugPossiblyPrint :: MonadClient m => Text -> m () Source #

createTabBFS :: MonadClient m => m (PrimArray PointI) Source #

dumpTextFile :: MonadClientRead m => Text -> FilePath -> m FilePath Source #

rndToAction :: MonadClient m => Rnd a -> m a Source #

Invoke pseudo-random computation with the generator kept in the state.

condInMeleeM :: MonadClientRead m => LevelId -> m Bool Source #

insertInMeleeM :: MonadClient m => LevelId -> m () Source #