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

Safe Haskell | None
Language | Haskell2010

Implementation.MonadServerImplementation

Contents

- Internal operations

Description

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

Synopsis

- executorSer :: COps -> CCUI -> ServerOptions -> UIOptions -> IO ()
- data SerState = SerState {
  - serState :: State
  - serServer :: StateServer
  - serDict :: ConnServerDict
  - serToSave :: ChanSave (State, StateServer)
  }
- newtype SerImplementation a = SerImplementation {
  - runSerImplementation :: StateT SerState IO a
  }

# Documentation

executorSer :: COps -> CCUI -> ServerOptions -> UIOptions -> IO () Source #

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

# Internal operations

data SerState Source #

Constructors

SerState |

Fields

- serState :: State

  current global state

- serServer :: StateServer

  current server state

- serDict :: ConnServerDict

  client-server connection information

- serToSave :: ChanSave (State, StateServer)

  connection to the save thread

newtype SerImplementation a Source #

Server state transformation monad.

Constructors

SerImplementation |

Fields

- runSerImplementation :: StateT SerState IO a

#### Instances

Instances details

MonadStateWrite SerImplementation Source # |
Instance details Defined in Implementation.MonadServerImplementation Methods modifyState :: (State -> State) -> SerImplementation () Source # putState :: State -> SerImplementation () Source #
MonadStateRead SerImplementation Source # |
Instance details Defined in Implementation.MonadServerImplementation Methods getsState :: (State -> a) -> SerImplementation a Source #
MonadServer SerImplementation Source # |
Instance details Defined in Implementation.MonadServerImplementation Methods getsServer :: (StateServer -> a) -> SerImplementation a Source # modifyServer :: (StateServer -> StateServer) -> SerImplementation () Source # chanSaveServer :: SerImplementation (ChanSave (State, StateServer)) Source # liftIO :: IO a -> SerImplementation a Source #
MonadServerAtomic SerImplementation Source # |

Instance details

Defined in Implementation.MonadServerImplementation

Methods

execUpdAtomic :: UpdAtomic -> SerImplementation () Source #

execUpdAtomicSer :: UpdAtomic -> SerImplementation Bool Source #

execUpdAtomicFid :: FactionId -> UpdAtomic -> SerImplementation () Source #

execUpdAtomicFidCatch :: FactionId -> UpdAtomic -> SerImplementation Bool Source #

execSfxAtomic :: SfxAtomic -> SerImplementation () Source #

execSendPer :: FactionId -> LevelId -> Perception -> Perception -> Perception -> SerImplementation () Source #

MonadServerComm SerImplementation Source # |
Instance details Defined in Implementation.MonadServerImplementation Methods getsDict :: (ConnServerDict -> a) -> SerImplementation a Source # putDict :: ConnServerDict -> SerImplementation () Source # liftIO :: IO a -> SerImplementation a Source #
Applicative SerImplementation Source # |

Instance details

Defined in Implementation.MonadServerImplementation

Methods

pure :: a -> SerImplementation a Source #

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

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

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

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

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