Safe Haskell | None |
---|---|
Language | Haskell2010 |
The main loop of the client, processing human and computer player moves turn by turn.
- class MonadClient m => MonadClientReadResponse m where
- loopCli :: (MonadClientSetup m, MonadClientUI m, MonadClientAtomic m, MonadClientReadResponse m, MonadClientWriteRequest m) => KeyKind -> UIOptions -> ClientOptions -> m ()
- initAI :: MonadClient m => m ()
- initUI :: MonadClientUI m => KeyKind -> UIOptions -> m ()
Documentation
class MonadClient m => MonadClientReadResponse m where Source #
Client monad in which one can receive responses from the server.
receiveResponse :: m Response Source #
loopCli :: (MonadClientSetup m, MonadClientUI m, MonadClientAtomic m, MonadClientReadResponse m, MonadClientWriteRequest m) => KeyKind -> UIOptions -> ClientOptions -> m () Source #
The main game loop for an AI or UI client. It receives responses from the server, changes internal client state accordingly, analyzes ensuing human or AI commands and sends resulting requests to the server. Depending on whether it's an AI or UI client, it sends AI or human player requests.
The loop is started in client state that is empty except for
the sside
and seps
fields, see emptyStateClient
.
Internal operations
initAI :: MonadClient m => m () Source #