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

Swarm.Game.Scenario.Objective.WinCheck

Description

Utilities to check whether conditions are met for a game win/loss.

Synopsis

Documentation

didWin :: ObjectiveCompletion -> Bool Source #

We have "won" if all of the "unwinnable" or remaining "incomplete" objectives are "optional".

didLose :: ObjectiveCompletion -> Bool Source #

We have "lost" if any of the "unwinnable" objectives are not "optional".

partitionActiveObjectives :: ObjectiveCompletion -> ([Objective], [Objective]) Source #

The first element of the returned tuple consists of "active" objectives, the second element "inactive".

data PrereqSatisfaction Source #

For debugging only (via Web API)

Instances

Instances details
ToJSON PrereqSatisfaction Source # 
Instance details

Defined in Swarm.Game.Scenario.Objective.WinCheck

Generic PrereqSatisfaction Source # 
Instance details

Defined in Swarm.Game.Scenario.Objective.WinCheck

Associated Types

type Rep PrereqSatisfaction :: Type -> Type #

ToSample PrereqSatisfaction Source # 
Instance details

Defined in Swarm.Game.Scenario.Objective.WinCheck

type Rep PrereqSatisfaction Source # 
Instance details

Defined in Swarm.Game.Scenario.Objective.WinCheck

type Rep PrereqSatisfaction = D1 ('MetaData "PrereqSatisfaction" "Swarm.Game.Scenario.Objective.WinCheck" "swarm-0.6.0.0-ERx1HMcRMba59aI2b6aNrS-swarm-engine" 'False) (C1 ('MetaCons "PrereqSatisfaction" 'PrefixI 'True) (S1 ('MetaSel ('Just "objective") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Objective) :*: (S1 ('MetaSel ('Just "deps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Set (Signed ObjectiveLabel))) :*: S1 ('MetaSel ('Just "prereqsSatisfied") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Bool))))

getSatisfaction :: ObjectiveCompletion -> [PrereqSatisfaction] Source #

Used only by the web interface for debugging