Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
High-level status of scenario play. Representation of progress, logic for updating.
Synopsis
- data ParameterizableLaunchParams code f = LaunchParams {
- seedVal :: f (Maybe Seed)
- initialCode :: f (Maybe code)
- type SerializableLaunchParams = ParameterizableLaunchParams FilePath Identity
- data ScenarioStatus
- getLaunchParams :: ScenarioStatus -> SerializableLaunchParams
- data ScenarioInfo = ScenarioInfo {}
- type ScenarioInfoPair = (Scenario, ScenarioInfo)
- scenarioPath :: Lens' ScenarioInfo FilePath
- scenarioStatus :: Lens' ScenarioInfo ScenarioStatus
- updateScenarioInfoOnFinish :: CodeSizeDeterminators -> ZonedTime -> TickNumber -> Bool -> ScenarioInfo -> ScenarioInfo
Documentation
data ParameterizableLaunchParams code f Source #
These launch parameters are used in a number of ways: * Serializing the seed/script path for saves * Holding parse status from form fields, including Error info * Carrying fully-validated launch parameters.
Type parameters are utilized to support all of these use cases.
LaunchParams | |
|
Instances
data ScenarioStatus Source #
A ScenarioStatus stores the status of a scenario along with appropriate metadata: NotStarted, or Played. The Played status has two sub-states: Attempted or Completed.
Instances
data ScenarioInfo Source #
A ScenarioInfo record stores metadata about a scenario: its canonical path and status. By way of the ScenarioStatus record, it stores the most recent status and best-ever status.
Instances
type ScenarioInfoPair = (Scenario, ScenarioInfo) Source #
scenarioPath :: Lens' ScenarioInfo FilePath Source #
The path of the scenario, relative to data/scenarios
.
scenarioStatus :: Lens' ScenarioInfo ScenarioStatus Source #
The status of the scenario.
updateScenarioInfoOnFinish :: CodeSizeDeterminators -> ZonedTime -> TickNumber -> Bool -> ScenarioInfo -> ScenarioInfo Source #
Update the current ScenarioInfo record when quitting a game.
Note that when comparing "best" times, shorter is not always better! As long as the scenario is not completed (e.g. some do not have win condition) we consider having fun _longer_ to be better.