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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.HighScore

Contents

Description

High score table operations.

Synopsis

Documentation

type ScoreDict = EnumMap (Id ModeKind) ScoreTable Source #

A dictionary from game mode IDs to scores tables.

data ScoreTable Source #

The list of scores, in decreasing order.

empty :: ScoreDict Source #

Empty score table

register Source #

Arguments

:: ScoreTable

old table

-> Int

the total value of faction items

-> Time

game time spent

-> Status

reason of the game interruption

-> POSIXTime

current date

-> Challenge

challenge setup

-> Text

name of the faction's gplayer

-> EnumMap (Id ItemKind) Int

allies lost

-> EnumMap (Id ItemKind) Int

foes killed

-> HiCondPoly 
-> (Bool, (ScoreTable, Int)) 

Register a new score in a score table.

showScore :: TimeZone -> (Int, ScoreRecord) -> [Text] Source #

Show a single high score, from the given ranking in the high score table.

highSlideshow Source #

Arguments

:: ScoreTable

current score table

-> Int

position of the current score in the table

-> Text

the name of the game mode

-> TimeZone

the timezone where the game is run

-> (Text, [[Text]]) 

Generate a slideshow with the current and previous scores.

Internal operations

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.

Instances

Eq ScoreRecord Source # 
Ord ScoreRecord Source # 
Show ScoreRecord Source # 
Generic ScoreRecord Source # 

Associated Types

type Rep ScoreRecord :: * -> * #

Binary ScoreRecord Source # 
type Rep ScoreRecord Source #