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

Swarm.Game.Scenario.Topography.Structure

Description

Definitions of "structures" for use within a map as well as logic for combining them.

Synopsis

Documentation

data PStructure c Source #

Constructors

Structure 

Fields

Instances

Instances details
FromJSONE e a => FromJSONE e (NamedStructure (Maybe a)) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure

FromJSONE e a => FromJSONE e (PStructure (Maybe a)) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure

Show (PStructure c) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure

Eq c => Eq (PStructure c) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure

Methods

(==) :: PStructure c -> PStructure c -> Bool #

(/=) :: PStructure c -> PStructure c -> Bool #

data Placed c Source #

Constructors

Placed Placement (NamedStructure c) 

Instances

Instances details
Show (Placed c) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure

Methods

showsPrec :: Int -> Placed c -> ShowS #

show :: Placed c -> String #

showList :: [Placed c] -> ShowS #

paintMap :: MonadFail m => Maybe Char -> StructurePalette c -> Grid Char -> m (Grid (Maybe c), [Waypoint], [Placement]) 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.

Orphan instances