LambdaHack-0.10.2.0: A game engine library for tactical squad ASCII roguelike dungeon crawlers
Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Atomic.MonadStateWrite

Description

The monad for writing to the main game state.

Synopsis

Documentation

class MonadStateRead m => MonadStateWrite m where Source #

The monad for writing to the main game state. Atomic updates (UpdAtomic) are given semantics in this monad.

Methods

modifyState :: (State -> State) -> m () Source #

putState :: State -> m () Source #

newtype AtomicFail Source #

Exception signifying that atomic action failed because the information it carries is inconsistent with the client's state, (e.g., because the client knows too little to understand the command or already deduced the state change from earlier commands or is confused, amnesiac or sees illusory actors or tiles). Whenever we know the failure is logically impossible, we don't throw the AtomicFail exception, but insert a normal assertion or error call, which are never caught nor handled.

Constructors

AtomicFail String 

Internal operations