License | BSD-3-Clause |
---|---|
Safe Haskell | None |
Language | Haskell2010 |
Swarm.Game.Scenario.Scoring.Best
Description
Types and records for updating and retrieving the best scores for a scenario.
Synopsis
- data BestByCriteria
- describeCriteria :: BestByCriteria -> Text
- data ProgressStats = ProgressStats {}
- scenarioAttemptMetrics :: Lens' ProgressStats AttemptMetrics
- scenarioStarted :: Lens' ProgressStats ZonedTime
- type ProgressMetric = Metric ProgressStats
- data BestRecords = BestRecords {}
- emptyBest :: ZonedTime -> BestRecords
- updateBest :: ProgressMetric -> BestRecords -> BestRecords
- scenarioBestByAstSize :: Lens' BestRecords ProgressMetric
- scenarioBestByCharCount :: Lens' BestRecords ProgressMetric
- scenarioBestByTicks :: Lens' BestRecords ProgressMetric
- scenarioBestByTime :: Lens' BestRecords ProgressMetric
- getBestGroups :: BestRecords -> [(Metric ProgressStats, NonEmpty BestByCriteria)]
Some orphan ZonedTime instances
High scores by various criteria
data BestByCriteria Source #
Constructors
BestByTime | |
BestByTicks | |
BestByCharCount | |
BestByAstSize |
Instances
data ProgressStats Source #
Constructors
ProgressStats | |
Fields
|
Instances
type ProgressMetric = Metric ProgressStats Source #
High scores by various criteria
data BestRecords Source #
Constructors
BestRecords | |
Instances
FromJSON BestRecords Source # | |||||
Defined in Swarm.Game.Scenario.Scoring.Best | |||||
ToJSON BestRecords Source # | |||||
Defined in Swarm.Game.Scenario.Scoring.Best Methods toJSON :: BestRecords -> Value # toEncoding :: BestRecords -> Encoding # toJSONList :: [BestRecords] -> Value # toEncodingList :: [BestRecords] -> Encoding # omitField :: BestRecords -> Bool # | |||||
Generic BestRecords Source # | |||||
Defined in Swarm.Game.Scenario.Scoring.Best Associated Types
| |||||
Read BestRecords Source # | |||||
Defined in Swarm.Game.Scenario.Scoring.Best Methods readsPrec :: Int -> ReadS BestRecords # readList :: ReadS [BestRecords] # readPrec :: ReadPrec BestRecords # readListPrec :: ReadPrec [BestRecords] # | |||||
Show BestRecords Source # | |||||
Defined in Swarm.Game.Scenario.Scoring.Best Methods showsPrec :: Int -> BestRecords -> ShowS # show :: BestRecords -> String # showList :: [BestRecords] -> ShowS # | |||||
Eq BestRecords Source # | |||||
Defined in Swarm.Game.Scenario.Scoring.Best | |||||
Ord BestRecords Source # | |||||
Defined in Swarm.Game.Scenario.Scoring.Best Methods compare :: BestRecords -> BestRecords -> Ordering # (<) :: BestRecords -> BestRecords -> Bool # (<=) :: BestRecords -> BestRecords -> Bool # (>) :: BestRecords -> BestRecords -> Bool # (>=) :: BestRecords -> BestRecords -> Bool # max :: BestRecords -> BestRecords -> BestRecords # min :: BestRecords -> BestRecords -> BestRecords # | |||||
type Rep BestRecords Source # | |||||
Defined in Swarm.Game.Scenario.Scoring.Best type Rep BestRecords = D1 ('MetaData "BestRecords" "Swarm.Game.Scenario.Scoring.Best" "swarm-0.7.0.0-IuFfgHrMoE7JrptOBRVOwx-swarm-engine" 'False) (C1 ('MetaCons "BestRecords" 'PrefixI 'True) ((S1 ('MetaSel ('Just "_scenarioBestByTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ProgressMetric) :*: S1 ('MetaSel ('Just "_scenarioBestByTicks") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ProgressMetric)) :*: (S1 ('MetaSel ('Just "_scenarioBestByCharCount") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ProgressMetric) :*: S1 ('MetaSel ('Just "_scenarioBestByAstSize") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ProgressMetric)))) |
emptyBest :: ZonedTime -> BestRecords Source #
updateBest :: ProgressMetric -> BestRecords -> BestRecords Source #
scenarioBestByAstSize :: Lens' BestRecords ProgressMetric Source #
The best code size of the scenario, measured in AST size.
scenarioBestByCharCount :: Lens' BestRecords ProgressMetric Source #
The best code size of the scenario, measured in character count.
scenarioBestByTicks :: Lens' BestRecords ProgressMetric Source #
The best status of the scenario, measured in game ticks.
scenarioBestByTime :: Lens' BestRecords ProgressMetric Source #
The best status of the scenario, measured in real world time.
getBestGroups :: BestRecords -> [(Metric ProgressStats, NonEmpty BestByCriteria)] Source #
Uses the start time of the play-attempt to de-dupe records that are from the same game. The start time should be sufficient to uniquely identify a game.
Orphan instances
Eq ZonedTime Source # | |
Ord ZonedTime Source # | |