LambdaHack-0.2.0: A roguelike game engine in early and very active development

Safe HaskellNone

Game.LambdaHack.Save

Description

Saving and restoring games and player diaries.

Synopsis

Documentation

saveGame :: State -> Diary -> IO ()Source

Save a simple serialized version of the current state and diary.

restoreGame :: (FilePath -> IO FilePath) -> CP -> String -> IO (Either (State, Diary) (String, Diary))Source

Restore a saved game, if it exists. Initialize directory structure, if needed.

rmBkpSaveDiary :: State -> Diary -> IO ()Source

Remove the backup of the savegame and save the player diary. Should be called before any non-error exit from the game. Sometimes the backup file does not exist and it's OK. We don't bother reporting any other removal exceptions, either, because the backup file is relatively unimportant.

saveGameBkp :: State -> Diary -> IO ()Source

Save the diary and a backup of the save game file, in case of crashes.