License | BSD-3-Clause |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data PrerequisiteConfig = PrerequisiteConfig {}
- data Objective = Objective {}
- objectiveGoal :: Lens' Objective (Document Syntax)
- objectiveTeaser :: Lens' Objective (Maybe Text)
- objectiveCondition :: Lens' Objective ProcessedTerm
- objectiveId :: Lens' Objective (Maybe Text)
- objectiveOptional :: Lens' Objective Bool
- objectivePrerequisite :: Lens' Objective (Maybe PrerequisiteConfig)
- objectiveHidden :: Lens' Objective Bool
- objectiveAchievement :: Lens' Objective (Maybe AchievementInfo)
- data CompletionBuckets = CompletionBuckets {
- incomplete :: [Objective]
- completed :: [Objective]
- unwinnable :: [Objective]
- newtype Announcement = ObjectiveCompleted Objective
- data ObjectiveCompletion = ObjectiveCompletion {}
- listAllObjectives :: CompletionBuckets -> [Objective]
- addCompleted :: Objective -> ObjectiveCompletion -> ObjectiveCompletion
- addUnwinnable :: Objective -> ObjectiveCompletion -> ObjectiveCompletion
- setIncomplete :: ([Objective] -> [Objective]) -> ObjectiveCompletion -> ObjectiveCompletion
- addIncomplete :: Objective -> ObjectiveCompletion -> ObjectiveCompletion
- extractIncomplete :: ObjectiveCompletion -> (ObjectiveCompletion, [Objective])
Documentation
data PrerequisiteConfig Source #
PrerequisiteConfig | |
|
Instances
An objective is a condition to be achieved by a player in a scenario.
Instances
objectiveGoal :: Lens' Objective (Document Syntax) Source #
An explanation of the goal of the objective, shown to the player during play. It is represented as a list of paragraphs.
objectiveTeaser :: Lens' Objective (Maybe Text) Source #
A very short (3-5 words) description of the goal for displaying on the left side of the Objectives modal.
objectiveCondition :: Lens' Objective ProcessedTerm Source #
A winning condition for the objective, expressed as a
program of type cmd bool
. By default, this program will be
run to completion every tick (the usual limits on the number
of CESK steps per tick do not apply).
objectiveId :: Lens' Objective (Maybe Text) Source #
Optional name by which this objective may be referenced as a prerequisite for other objectives.
objectiveOptional :: Lens' Objective Bool Source #
Indicates whether the objective is not required in order to "win" the scenario. Useful for (potentially hidden) achievements. If the field is not supplied, it defaults to False (i.e. the objective is mandatory to "win").
objectivePrerequisite :: Lens' Objective (Maybe PrerequisiteConfig) Source #
Dependencies upon other objectives
objectiveHidden :: Lens' Objective Bool Source #
Whether the goal is displayed in the UI before completion. The goal will always be revealed after it is completed.
This attribute often goes along with an Achievement.
objectiveAchievement :: Lens' Objective (Maybe AchievementInfo) Source #
An optional achievement that is to be registered globally when this objective is completed.
data CompletionBuckets Source #
CompletionBuckets | |
|
Instances
newtype Announcement Source #
TODO: #1044 Could also add an ObjectiveFailed constructor...
Instances
ToJSON Announcement Source # | |
Defined in Swarm.Game.Scenario.Objective toJSON :: Announcement -> Value # toEncoding :: Announcement -> Encoding # toJSONList :: [Announcement] -> Value # toEncodingList :: [Announcement] -> Encoding # | |
Generic Announcement Source # | |
Defined in Swarm.Game.Scenario.Objective type Rep Announcement :: Type -> Type # from :: Announcement -> Rep Announcement x # to :: Rep Announcement x -> Announcement # | |
Show Announcement Source # | |
Defined in Swarm.Game.Scenario.Objective showsPrec :: Int -> Announcement -> ShowS # show :: Announcement -> String # showList :: [Announcement] -> ShowS # | |
type Rep Announcement Source # | |
Defined in Swarm.Game.Scenario.Objective type Rep Announcement = D1 ('MetaData "Announcement" "Swarm.Game.Scenario.Objective" "swarm-0.5.0.0-6qXEbhCmuXA4wRndqqhBu" 'True) (C1 ('MetaCons "ObjectiveCompleted" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Objective))) |
data ObjectiveCompletion Source #
ObjectiveCompletion | |
|
Instances
listAllObjectives :: CompletionBuckets -> [Objective] Source #
Concatenates all incomplete and completed objectives.
setIncomplete :: ([Objective] -> [Objective]) -> ObjectiveCompletion -> ObjectiveCompletion Source #
extractIncomplete :: ObjectiveCompletion -> (ObjectiveCompletion, [Objective]) Source #
Returns the ObjectiveCompletion with the "incomplete" goals extracted to a separate tuple member. This is intended as input to a "fold".