swarm-0.5.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellSafe-Inferred
LanguageHaskell2010

Swarm.Game.Scenario.Scoring.Best

Description

Types and records for updating and retrieving the best scores for a scenario.

Synopsis

Some orphan ZonedTime instances

High scores by various criteria

data BestByCriteria Source #

Instances

Instances details
Bounded BestByCriteria Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Enum BestByCriteria Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Show BestByCriteria Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Eq BestByCriteria Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Ord BestByCriteria Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

data ProgressStats Source #

Constructors

ProgressStats 

Fields

Instances

Instances details
FromJSON ProgressStats Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

ToJSON ProgressStats Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Generic ProgressStats Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Associated Types

type Rep ProgressStats :: Type -> Type #

Read ProgressStats Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Show ProgressStats Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Eq ProgressStats Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Ord ProgressStats Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

type Rep ProgressStats Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

type Rep ProgressStats = D1 ('MetaData "ProgressStats" "Swarm.Game.Scenario.Scoring.Best" "swarm-0.5.0.0-6qXEbhCmuXA4wRndqqhBu" 'False) (C1 ('MetaCons "ProgressStats" 'PrefixI 'True) (S1 ('MetaSel ('Just "_scenarioStarted") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 ZonedTime) :*: S1 ('MetaSel ('Just "_scenarioAttemptMetrics") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 AttemptMetrics)))

High scores by various criteria

data BestRecords Source #

Instances

Instances details
FromJSON BestRecords Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

ToJSON BestRecords Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Generic BestRecords Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Associated Types

type Rep BestRecords :: Type -> Type #

Read BestRecords Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Show BestRecords Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Eq BestRecords Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

Ord BestRecords Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

type Rep BestRecords Source # 
Instance details

Defined in Swarm.Game.Scenario.Scoring.Best

type Rep BestRecords = D1 ('MetaData "BestRecords" "Swarm.Game.Scenario.Scoring.Best" "swarm-0.5.0.0-6qXEbhCmuXA4wRndqqhBu" '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))))

scenarioBestByTime :: Lens' BestRecords ProgressMetric Source #

The best status of the scenario, measured in real world time.

scenarioBestByTicks :: Lens' BestRecords ProgressMetric Source #

The best status of the scenario, measured in game ticks.

scenarioBestByCharCount :: Lens' BestRecords ProgressMetric Source #

The best code size of the scenario, measured in character count.

scenarioBestByAstSize :: Lens' BestRecords ProgressMetric Source #

The best code size of the scenario, measured in AST size.

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