Safe Haskell | None |
---|---|
Language | Haskell2010 |
Generation of places from place kinds.
- type TileMapEM = EM.EnumMap Point (Id TileKind)
- data Place = Place {}
- placeCheck :: Area -> PlaceKind -> Bool
- buildFenceRnd :: COps -> GroupName TileKind -> Area -> Rnd TileMapEM
- buildPlace :: COps -> CaveKind -> Bool -> Id TileKind -> Id TileKind -> AbsDepth -> AbsDepth -> Area -> Rnd (TileMapEM, Place)
Documentation
type TileMapEM = EM.EnumMap Point (Id TileKind) Source
The map of tile kinds in a place (and generally anywhere in a cave).
The map is sparse. The default tile that eventually fills the empty spaces
is specified in the cave kind specification with cdefTile
.
The parameters of a place. Most are immutable and set at the time when a place is generated.
For CAlternate
tiling, require the place be comprised
of an even number of whole corners, with exactly one square
overlap between consecutive coners and no trimming.
For other tiling methods, check that the area is large enough for tiling
the corner twice in each direction, with a possible one row/column overlap.
buildFenceRnd :: COps -> GroupName TileKind -> Area -> Rnd TileMapEM Source
Construct a fence around an area, with the given tile group.
:: COps | the game content |
-> CaveKind | current cave kind |
-> Bool | whether the cave is dark |
-> Id TileKind | dark fence tile, if fence hollow |
-> Id TileKind | lit fence tile, if fence hollow |
-> AbsDepth | current level depth |
-> AbsDepth | absolute depth |
-> Area | whole area of the place, fence included |
-> Rnd (TileMapEM, Place) |
Given a few parameters, roll and construct a Place
datastructure
and fill a cave section acccording to it.