License | BSD-3-Clause |
---|---|
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Definitions of "structures" for use within a map as well as logic for combining them.
Synopsis
- data NamedArea a = NamedArea {
- name :: StructureName
- recognize :: Set AbsoluteDir
- description :: Maybe Text
- structure :: a
- isRecognizable :: NamedArea a -> Bool
- type NamedGrid c = NamedArea (Grid c)
- type NamedStructure c = NamedArea (PStructure c)
- data PStructure c = Structure {
- area :: PositionedGrid c
- structures :: [NamedStructure c]
- placements :: [Placement]
- waypoints :: [Waypoint]
- data Placed c = Placed Placement (NamedStructure c)
- data LocatedStructure = LocatedStructure {}
- data MergedStructure c = MergedStructure (PositionedGrid c) [LocatedStructure] [Originated Waypoint]
- paintMap :: MonadFail m => Maybe Char -> StructurePalette c -> Grid Char -> m (Grid (Maybe c), [Waypoint])
Documentation
NamedArea | |
|
Instances
Functor NamedArea Source # | |
FromJSONE e a => FromJSONE e (NamedStructure (Maybe a)) Source # | |
Defined in Swarm.Game.Scenario.Topography.Structure parseJSONE :: Value -> ParserE e (NamedStructure (Maybe a)) # parseJSONE' :: e -> Value -> Parser (NamedStructure (Maybe a)) # | |
Show a => Show (NamedArea a) Source # | |
Eq a => Eq (NamedArea a) Source # | |
isRecognizable :: NamedArea a -> Bool Source #
type NamedStructure c = NamedArea (PStructure c) Source #
data PStructure c Source #
Structure | |
|
Instances
FromJSONE e a => FromJSONE e (NamedStructure (Maybe a)) Source # | |
Defined in Swarm.Game.Scenario.Topography.Structure parseJSONE :: Value -> ParserE e (NamedStructure (Maybe a)) # parseJSONE' :: e -> Value -> Parser (NamedStructure (Maybe a)) # | |
FromJSONE e a => FromJSONE e (PStructure (Maybe a)) Source # | |
Defined in Swarm.Game.Scenario.Topography.Structure parseJSONE :: Value -> ParserE e (PStructure (Maybe a)) # parseJSONE' :: e -> Value -> Parser (PStructure (Maybe a)) # | |
Show (PStructure c) Source # | |
Defined in Swarm.Game.Scenario.Topography.Structure showsPrec :: Int -> PStructure c -> ShowS # show :: PStructure c -> String # showList :: [PStructure c] -> ShowS # | |
Eq c => Eq (PStructure c) Source # | |
Defined in Swarm.Game.Scenario.Topography.Structure (==) :: PStructure c -> PStructure c -> Bool # (/=) :: PStructure c -> PStructure c -> Bool # |
data LocatedStructure Source #
For use in registering recognizable pre-placed structures
Instances
Show LocatedStructure Source # | |
Defined in Swarm.Game.Scenario.Topography.Structure showsPrec :: Int -> LocatedStructure -> ShowS # show :: LocatedStructure -> String # showList :: [LocatedStructure] -> ShowS # | |
HasLocation LocatedStructure Source # | |
Defined in Swarm.Game.Scenario.Topography.Structure modifyLoc :: (Location -> Location) -> LocatedStructure -> LocatedStructure Source # offsetLoc :: V2 Int32 -> LocatedStructure -> LocatedStructure Source # |
data MergedStructure c Source #
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.