swarm-0.3.0.1: 2D resource gathering game with programmable robots
Safe HaskellSafe-Inferred
LanguageHaskell2010

Swarm.Game.Scenario.RobotLookup

Synopsis

Documentation

type IndexedTRobot = (Int, TRobot) Source #

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

type RobotMap = Map Text 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 :: String -> (Text -> m -> Maybe a) -> Text -> 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 :: Text -> ParserE RobotMap IndexedTRobot Source #

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