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

Swarm.Game.Scenario.WorldDescription

Synopsis

Documentation

newtype WorldPalette e Source #

A world palette maps characters to PCell values.

Constructors

WorldPalette 

Fields

data PWorldDescription e Source #

A description of a world parsed from a YAML file. This type is parameterized to accommodate Cells that utilize a less stateful Entity type.

Constructors

WorldDescription 

paintMap :: MonadFail m => WorldPalette e -> Text -> m [[PCell e]] Source #

Paint a world map using a WorldPalette, turning it from a raw string into a nested list of PCell values by looking up each character in the palette, failing if any character in the raw map is not contained in the palette.