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

Safe Haskell | None
Language | Haskell2010

Implementation.MonadClientImplementation

Contents

- Internal operations

Description

The implementation of our custom game client monads. Just as any other component of the library, this implementation can be substituted.

Synopsis

- executorCli :: CCUI -> UIOptions -> ClientOptions -> Bool -> COps -> FactionId -> ChanServer -> IO ()
- data CliState = CliState {
  - cliState :: State
  - cliClient :: StateClient
  - cliSession :: Maybe SessionUI
  - cliDict :: ChanServer
  - cliToSave :: ChanSave (StateClient, Maybe SessionUI)
  }
- newtype CliImplementation a = CliImplementation {
  - runCliImplementation :: StateT CliState IO a
  }

# Documentation

executorCli :: CCUI -> UIOptions -> ClientOptions -> Bool -> COps -> FactionId -> ChanServer -> IO () Source #

Run the main client loop, with the given arguments and empty initial states, in the `IO` monad.

# Internal operations

data CliState Source #

Constructors

CliState |

Fields

- cliState :: State

  current global state

- cliClient :: StateClient

  current client state

- cliSession :: Maybe SessionUI

  UI state, empty for AI clients

- cliDict :: ChanServer

  this client connection information

- cliToSave :: ChanSave (StateClient, Maybe SessionUI)

  connection to the save thread

newtype CliImplementation a Source #

Client state transformation monad.

Constructors

CliImplementation |

Fields

- runCliImplementation :: StateT CliState IO a

#### Instances

Instances details

MonadStateWrite CliImplementation Source # |
Instance details Defined in Implementation.MonadClientImplementation Methods modifyState :: (State -> State) -> CliImplementation () Source # putState :: State -> CliImplementation () Source #
MonadClientSetup CliImplementation Source # |
Instance details Defined in Implementation.MonadClientImplementation Methods saveClient :: CliImplementation () Source #
MonadClientAtomic CliImplementation Source # |
Instance details Defined in Implementation.MonadClientImplementation Methods execUpdAtomic :: UpdAtomic -> CliImplementation () Source # execPutState :: State -> CliImplementation () Source #
MonadClientWriteRequest CliImplementation Source # |
Instance details Defined in Implementation.MonadClientImplementation Methods sendRequestAI :: RequestAI -> CliImplementation () Source # sendRequestUI :: RequestUI -> CliImplementation () Source # clientHasUI :: CliImplementation Bool Source #
MonadClientReadResponse CliImplementation Source # |
Instance details Defined in Implementation.MonadClientImplementation Methods receiveResponse :: CliImplementation Response Source #
MonadClient CliImplementation Source # |
Instance details Defined in Implementation.MonadClientImplementation Methods modifyClient :: (StateClient -> StateClient) -> CliImplementation () Source #
MonadClientRead CliImplementation Source # |
Instance details Defined in Implementation.MonadClientImplementation Methods getsClient :: (StateClient -> a) -> CliImplementation a Source # liftIO :: IO a -> CliImplementation a Source #
MonadClientUI CliImplementation Source # |

Instance details

Defined in Implementation.MonadClientImplementation

Methods

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 #

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

Instance details

Defined in Implementation.MonadClientImplementation

Methods

pure :: a -> CliImplementation a Source #

(<*>) :: CliImplementation (a -> b) -> CliImplementation a -> CliImplementation b Source #

liftA2 :: (a -> b -> c) -> CliImplementation a -> CliImplementation b -> CliImplementation c Source #

(*>) :: CliImplementation a -> CliImplementation b -> CliImplementation b Source #

(<*) :: CliImplementation a -> CliImplementation b -> CliImplementation a Source #

Functor CliImplementation Source # |
Instance details Defined in Implementation.MonadClientImplementation Methods fmap :: (a -> b) -> CliImplementation a -> CliImplementation b Source # (<$) :: a -> CliImplementation b -> CliImplementation a Source #
Monad CliImplementation Source # |
Instance details Defined in Implementation.MonadClientImplementation Methods (>>=) :: CliImplementation a -> (a -> CliImplementation b) -> CliImplementation b Source # (>>) :: CliImplementation a -> CliImplementation b -> CliImplementation b Source # return :: a -> CliImplementation a Source #