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

Constructors

NamedArea 

Fields

  • name :: StructureName
     
  • recognize :: Set AbsoluteDir

    whether this structure should be registered for automatic recognition and which orientations shall be recognized. The supplied direction indicates which cardinal direction the original map's North has been re-oriented to. E.g., DWest represents a rotation of 90 degrees counter-clockwise.

  • description :: Maybe Text

    will be UI-facing only if this is a recognizable structure

  • structure :: a
     

Instances

Instances details
Functor NamedArea Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure

Methods

fmap :: (a -> b) -> NamedArea a -> NamedArea b #

(<$) :: a -> NamedArea b -> NamedArea a #

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

Defined in Swarm.Game.Scenario.Topography.Structure

Show a => Show (NamedArea a) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure

Eq a => Eq (NamedArea a) Source # 
Instance details

Defined in Swarm.Game.Scenario.Topography.Structure

Methods

(==) :: NamedArea a -> NamedArea a -> Bool #

(/=) :: NamedArea a -> NamedArea a -> Bool #

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]) 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