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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.Save

Contents

Description

Saving and restoring game state, used by both server and clients.

Synopsis

Documentation

type ChanSave a = MVar (Maybe a) Source #

saveToChan :: ChanSave a -> a -> IO () Source #

wrapInSaves :: Binary a => COps -> (a -> FilePath) -> (ChanSave a -> IO ()) -> IO () Source #

restoreGame :: Binary a => COps -> FilePath -> IO (Maybe a) Source #

Restore a saved game, if it exists. Initialize directory structure and copy over data files, if needed.

Internal operations

loopSave :: Binary a => COps -> (a -> FilePath) -> ChanSave a -> IO () Source #

Repeatedly save serialized snapshots of current state.