swarm-0.5.0.0: 2D resource gathering game with programmable robots
LicenseBSD-3-Clause
Safe HaskellSafe-Inferred
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 :: Type -> Type #

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 (EntityMap, RobotMap) Cell Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Cell

FromJSONE (EntityMap, RobotMap) (AugmentedCell Entity) Source #

Parse a tuple such as [grass, rock, base] into a PCell. 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

FromJSONE (EntityMap, RobotMap) (NamedStructure (Maybe (PCell Entity))) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure

FromJSONE (EntityMap, RobotMap) (PStructure (Maybe (PCell Entity))) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure

FromJSONE (EntityMap, RobotMap) (WorldPalette Entity) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.WorldPalette

FromJSONE (WorldMap, InheritedStructureDefs, EntityMap, RobotMap) WorldDescription Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.WorldDescription

type Rep RobotName Source # 
Instance details

Defined in Swarm.Game.Scenario.RobotLookup

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