Safe Haskell | None |
---|---|
Language | Haskell2010 |
High score table operations.
- data ScoreTable
- empty :: ScoreTable
- register :: ScoreTable -> Int -> Time -> Status -> ClockTime -> Int -> T.Text -> EM.EnumMap (Id ItemKind) Int -> EM.EnumMap (Id ItemKind) Int -> Bool -> (Bool, (ScoreTable, Int))
- showScore :: (Int, ScoreRecord) -> [T.Text]
- getRecord :: Int -> ScoreTable -> ScoreRecord
- highSlideshow :: ScoreTable -> Int -> Slideshow
- data ScoreRecord
Documentation
data ScoreTable Source
The list of scores, in decreasing order.
Empty score table
:: ScoreTable | old table |
-> Int | the total value of faction items |
-> Time | game time spent |
-> Status | reason of the game interruption |
-> ClockTime | current date |
-> Int | difficulty level |
-> T.Text | name of the faction's gplayer |
-> EM.EnumMap (Id ItemKind) Int | allies lost |
-> EM.EnumMap (Id ItemKind) Int | foes killed |
-> Bool | whether the faction fights against spawners |
-> (Bool, (ScoreTable, Int)) |
Register a new score in a score table.
showScore :: (Int, ScoreRecord) -> [T.Text] Source
Show a single high score, from the given ranking in the high score table.
getRecord :: Int -> ScoreTable -> ScoreRecord Source
:: ScoreTable | current score table |
-> Int | position of the current score in the table |
-> Slideshow |
Generate a slideshow with the current and previous scores.
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.