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

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Common.HighScore

Contents

Description

High score table operations.

Synopsis

Documentation

data ScoreTable Source #

The list of scores, in decreasing order.

type ScoreDict = EnumMap (ContentId ModeKind) ScoreTable Source #

A dictionary from game mode IDs to scores tables.

empty :: ScoreDict Source #

Empty score table

register Source #

Arguments

:: ScoreTable

old table

-> Int

the total value of faction items

-> Int

the total value of dungeon 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 (ContentId ItemKind) Int

allies lost

-> EnumMap (ContentId 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.

showAward Source #

Arguments

:: Int

number of (3-line) scores to be shown

-> ScoreTable

current score table

-> Int

position of the current score in the table

-> Text

the name of the game mode

-> Text 

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 # 
Instance details

Defined in Game.LambdaHack.Common.HighScore

Ord ScoreRecord Source # 
Instance details

Defined in Game.LambdaHack.Common.HighScore

Show ScoreRecord Source # 
Instance details

Defined in Game.LambdaHack.Common.HighScore

Generic ScoreRecord Source # 
Instance details

Defined in Game.LambdaHack.Common.HighScore

Associated Types

type Rep ScoreRecord :: Type -> Type #

Binary ScoreRecord Source # 
Instance details

Defined in Game.LambdaHack.Common.HighScore

type Rep ScoreRecord Source # 
Instance details

Defined in Game.LambdaHack.Common.HighScore

insertPos :: ScoreRecord -> ScoreTable -> (ScoreTable, Int) Source #

Insert a new score into the table, Return new table and the ranking. Make sure the table doesn't grow too large.