LambdaHack-0.7.0.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Atomic.MonadStateWrite

Contents

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.

Minimal complete definition

modifyState

Methods

modifyState :: (State -> 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 

addAis :: MonadStateWrite m => [(ItemId, Item)] -> m () Source #

Internal operations