swarm-0.7.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellNone
LanguageHaskell2010

Swarm.Game.Scenario.RobotLookup

Description

 
Synopsis

Documentation

newtype RobotName Source #

Constructors

RobotName Text 

Instances

Instances details
FromJSON RobotName Source # 
Instance details

Defined in Swarm.Game.Scenario.RobotLookup

Generic RobotName Source # 
Instance details

Defined in Swarm.Game.Scenario.RobotLookup

Associated Types

type Rep RobotName 
Instance details

Defined in Swarm.Game.Scenario.RobotLookup

type Rep RobotName = D1 ('MetaData "RobotName" "Swarm.Game.Scenario.RobotLookup" "swarm-0.7.0.0-IuFfgHrMoE7JrptOBRVOwx-swarm-scenario" 'True) (C1 ('MetaCons "RobotName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))
Show RobotName Source # 
Instance details

Defined in Swarm.Game.Scenario.RobotLookup

Eq RobotName Source # 
Instance details

Defined in Swarm.Game.Scenario.RobotLookup

Ord RobotName Source # 
Instance details

Defined in Swarm.Game.Scenario.RobotLookup

FromJSONE (TerrainEntityMaps, RobotMap) Cell

Parse a tuple such as [grass, rock, base] into a Cell. The entity and robot, if present, are immediately looked up and converted into Entity and TRobot values. If they are not found, a parse error results.

Instance details

Defined in Swarm.Game.Scenario.Topography.Cell

type Rep RobotName Source # 
Instance details

Defined in Swarm.Game.Scenario.RobotLookup

type Rep RobotName = D1 ('MetaData "RobotName" "Swarm.Game.Scenario.RobotLookup" "swarm-0.7.0.0-IuFfgHrMoE7JrptOBRVOwx-swarm-scenario" 'True) (C1 ('MetaCons "RobotName" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

type IndexedTRobot = (Int, TRobot) Source #

A robot template paired with its definition's index within the Scenario file

type RobotMap = Map RobotName IndexedTRobot Source #

A map from names to robots, used to look up robots in scenario descriptions.

buildRobotMap :: [TRobot] -> RobotMap Source #

Create a RobotMap from a list of robot templates.

getThing :: Show k => Text -> (k -> m -> Maybe a) -> k -> ParserE m a Source #

Look up a thing by name, throwing a parse error if it is not found.

getEntity :: Text -> ParserE EntityMap Entity Source #

Look up an entity by name in an EntityMap, throwing a parse error if it is not found.

getRobot :: RobotName -> ParserE RobotMap IndexedTRobot Source #

Look up a robot by name in a RobotMap, throwing a parse error if it is not found.