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

Safe HaskellNone

Game.LambdaHack.HighScore

Description

High score table operations.

Synopsis

Documentation

data Status Source

Current result of the game.

Constructors

Killed !LevelId

the player lost the game on the given level

Camping

game is supended

Victor

the player won

data ScoreRecord Source

A single score record. Records are ordered in the highscore table, from the best to the worst, in lexicographic ordering wrt the fields below.

Constructors

ScoreRecord 

Fields

points :: !Int

the score

negTurn :: !Int

number of turns (negated, so less better)

date :: !ClockTime

date of the last game interruption

status :: !Status

reason of the game interruption

type ScoreTable = [ScoreRecord]Source

The list of scores, in decreasing order.

restore :: CP -> IO ScoreTableSource

Read the high scores table. Return the empty table if no file.

register :: CP -> Bool -> ScoreRecord -> IO (String, [String])Source

Take care of saving a new score to the table and return a list of messages to display.

slideshow :: Int -> ScoreTable -> Int -> [String]Source

Produce a couple of renderings of the high scores table.